pub struct HostsFile {
pub version: u32,
pub default_host: Option<String>,
pub hosts: HashMap<String, HostConfig>,
}Expand description
Root structure for hosts.json file
Fields§
§version: u32Schema version for future migrations
default_host: Option<String>Default host name (None = local Docker)
hosts: HashMap<String, HostConfig>Map of host name to configuration
Implementations§
Source§impl HostsFile
impl HostsFile
Sourcepub fn add_host(&mut self, name: impl Into<String>, config: HostConfig)
pub fn add_host(&mut self, name: impl Into<String>, config: HostConfig)
Add a host
Sourcepub fn remove_host(&mut self, name: &str) -> Option<HostConfig>
pub fn remove_host(&mut self, name: &str) -> Option<HostConfig>
Remove a host
Sourcepub fn get_host(&self, name: &str) -> Option<&HostConfig>
pub fn get_host(&self, name: &str) -> Option<&HostConfig>
Get a host by name
Sourcepub fn get_host_mut(&mut self, name: &str) -> Option<&mut HostConfig>
pub fn get_host_mut(&mut self, name: &str) -> Option<&mut HostConfig>
Get mutable reference to a host
Sourcepub fn set_default(&mut self, name: Option<String>)
pub fn set_default(&mut self, name: Option<String>)
Set the default host
Sourcepub fn host_names(&self) -> Vec<&str>
pub fn host_names(&self) -> Vec<&str>
Get list of host names
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HostsFile
impl<'de> Deserialize<'de> for HostsFile
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 HostsFile
Auto Trait Implementations§
impl Freeze for HostsFile
impl RefUnwindSafe for HostsFile
impl Send for HostsFile
impl Sync for HostsFile
impl Unpin for HostsFile
impl UnwindSafe for HostsFile
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request