pub struct Config {
pub settings: Settings,
pub hosts: Vec<Host>,
pub scenarios: Vec<Scenario>,
}Fields§
§settings: Settings§hosts: Vec<Host>§scenarios: Vec<Scenario>Implementations§
Source§impl Config
impl Config
pub fn config_dir() -> Result<PathBuf, ConfigError>
pub fn default_path() -> Result<PathBuf, ConfigError>
pub fn load(path: &Path) -> Result<Self, ConfigError>
pub fn save(&self, path: &Path) -> Result<(), ConfigError>
Source§impl Config
impl Config
pub fn add_host(&mut self, host: Host) -> Result<(), HostError>
pub fn remove_host(&mut self, alias: &str) -> Result<Host, HostError>
pub fn update_host( &mut self, alias: &str, updated: Host, ) -> Result<(), HostError>
pub fn find_host(&self, alias: &str) -> Option<&Host>
pub fn find_host_mut(&mut self, alias: &str) -> Option<&mut Host>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more