pub struct Hosts(/* private fields */);Expand description
Mapped host configs by their hostname.
Implementations§
source§impl Hosts
impl Hosts
sourcepub fn load_from<P>(path: P) -> Result<Self, Error>
pub fn load_from<P>(path: P) -> Result<Self, Error>
Loads all host configs from the specified path.
sourcepub fn set(&mut self, hostname: impl Into<String>, host: Host) -> Option<Host>
pub fn set(&mut self, hostname: impl Into<String>, host: Host) -> Option<Host>
Sets a host config and returns the current value.
If no values present currently, returns None .
Trait Implementations§
source§impl<'de> Deserialize<'de> for Hosts
impl<'de> Deserialize<'de> for Hosts
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 Hosts
impl RefUnwindSafe for Hosts
impl Send for Hosts
impl Sync for Hosts
impl Unpin for Hosts
impl UnwindSafe for Hosts
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