use serde::Deserialize; use std::path::PathBuf; #[derive(Deserialize, Debug)] pub struct Config { pub to: String, pub from: String, pub account_sid: String, pub auth_token: String, pub reboot: RebootConfig, } #[derive(Deserialize, Debug)] pub struct RebootConfig { pub ifname: String, } impl Config { pub fn load_from_file(filename: &PathBuf) -> std::io::Result { let content = std::fs::read_to_string(filename)?; Ok(toml::from_str(&content)?) } }