client-rust 0.1.0

Rust client for fleet
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use serde::Deserialize;

#[derive(Debug, Deserialize)]
pub struct ClientConfig {
    pub base_url: String,
}

impl ClientConfig {
    pub fn from_file(path: &str) -> Result<Self, Box<dyn std::error::Error>> {
        let content = std::fs::read_to_string(path)?;
        let config: Self = serde_yaml::from_str(&content)?;
        Ok(config)
    }
}