use serde_derive::{Deserialize, Serialize}; #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Server { pub listen: String, } #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Service { pub name: String, pub addr: String, // host:port } #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Client { pub addr: String, } #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Root { pub server: Option, pub client: Option, pub service: Vec, #[serde(default = "default_true")] pub allow_help: bool, } fn default_true() -> bool { true }