pub struct ConfigFile {
pub defaults: Defaults,
pub host: HashMap<String, HostConfig>,
}Expand description
Top-level config file structure.
Fields§
§defaults: Defaults§host: HashMap<String, HostConfig>Implementations§
Source§impl ConfigFile
impl ConfigFile
Sourcepub fn load() -> Self
pub fn load() -> Self
Load config from the default path. Returns default on missing or malformed file.
Sourcepub fn load_from(path: &Path) -> Self
pub fn load_from(path: &Path) -> Self
Load config from a specific path. Returns default on missing or malformed file.
Sourcepub fn resolve_session(&self, host: Option<&str>) -> SessionSettings
pub fn resolve_session(&self, host: Option<&str>) -> SessionSettings
Resolve session settings for a given host (or None for local).
Sourcepub fn resolve_connect(&self, host: &str) -> ConnectSettings
pub fn resolve_connect(&self, host: &str) -> ConnectSettings
Resolve connect settings for a given host.
Trait Implementations§
Source§impl Clone for ConfigFile
impl Clone for ConfigFile
Source§fn clone(&self) -> ConfigFile
fn clone(&self) -> ConfigFile
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfigFile
impl Debug for ConfigFile
Source§impl Default for ConfigFile
impl Default for ConfigFile
Source§fn default() -> ConfigFile
fn default() -> ConfigFile
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ConfigFilewhere
ConfigFile: Default,
impl<'de> Deserialize<'de> for ConfigFilewhere
ConfigFile: Default,
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
Auto Trait Implementations§
impl Freeze for ConfigFile
impl RefUnwindSafe for ConfigFile
impl Send for ConfigFile
impl Sync for ConfigFile
impl Unpin for ConfigFile
impl UnsafeUnpin for ConfigFile
impl UnwindSafe for ConfigFile
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