use crate::AppConfig; impl AppConfig { pub fn pr_rpc_addr(&self) -> anyhow::Result { self.env .get("APP_PR_RPC_ADDR") .map(|v| v.trim().to_string()) .ok_or_else(|| anyhow::anyhow!("APP_PR_RPC_ADDR not set")) } pub fn pr_rpc_port(&self) -> anyhow::Result { if let Some(port) = self.env.get("APP_PR_RPC_PORT") { return Ok(port.parse::()?); } Ok(8040) } pub fn pr_http_port(&self) -> anyhow::Result { if let Some(port) = self.env.get("APP_PR_HTTP_PORT") { return Ok(port.parse::()?); } Ok(8041) } }