client_rust/config.rs
1use serde::Deserialize;
2
3#[derive(Debug, Deserialize)]
4pub struct ClientConfig {
5 pub base_url: String,
6}
7
8impl ClientConfig {
9 pub fn from_file(path: &str) -> Result<Self, Box<dyn std::error::Error>> {
10 let content = std::fs::read_to_string(path)?;
11 let config: Self = serde_yaml::from_str(&content)?;
12 Ok(config)
13 }
14}