pub struct HostBlock {
pub host_pattern: String,
pub raw_host_line: String,
pub directives: Vec<Directive>,
}Expand description
A parsed Host block with its directives.
Fields§
§host_pattern: StringThe host alias/pattern (the value after “Host”).
raw_host_line: StringThe original raw “Host …” line for faithful reproduction.
directives: Vec<Directive>Parsed directives inside this block.
Implementations§
Source§impl HostBlock
impl HostBlock
Extract tags from purple:tags comment in directives.
Sourcepub fn provider(&self) -> Option<(String, String)>
pub fn provider(&self) -> Option<(String, String)>
Extract provider info from purple:provider comment in directives. Returns (provider_name, server_id), e.g. (“digitalocean”, “412345678”).
Sourcepub fn set_provider(&mut self, provider_name: &str, server_id: &str)
pub fn set_provider(&mut self, provider_name: &str, server_id: &str)
Set provider on a host block. Replaces existing purple:provider comment or adds one.
Set tags on a host block. Replaces existing purple:tags comment or adds one.
Sourcepub fn to_host_entry(&self) -> HostEntry
pub fn to_host_entry(&self) -> HostEntry
Extract a convenience HostEntry view from this block.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HostBlock
impl RefUnwindSafe for HostBlock
impl Send for HostBlock
impl Sync for HostBlock
impl Unpin for HostBlock
impl UnsafeUnpin for HostBlock
impl UnwindSafe for HostBlock
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