use crate::config::ProxyConfig;
use crate::error::ProxyResult;
use std::path::Path;
pub async fn load_from_file(path: impl AsRef<Path>) -> ProxyResult<ProxyConfig> {
let content = tokio::fs::read_to_string(path).await?;
let config: ProxyConfig = toml::from_str(&content)?;
Ok(config)
}