pub enum ConfigNode {
BlankLine,
Comment {
text: String,
indent: String,
},
Directive(Box<DirectiveData>),
HostBlock(Box<HostBlockData>),
MatchBlock(Box<MatchBlockData>),
}Expand description
A single node in the SSH config AST.
Variants§
BlankLine
An empty / blank line.
Comment
A comment line (including the leading #).
Fields
Directive(Box<DirectiveData>)
A standalone directive (not inside a Host/Match block).
HostBlock(Box<HostBlockData>)
A Host block containing nested directives.
MatchBlock(Box<MatchBlockData>)
A Match block containing nested directives.
Implementations§
Source§impl ConfigNode
impl ConfigNode
Sourcepub fn as_host_block(&self) -> Option<(&[String], &[Self])>
pub fn as_host_block(&self) -> Option<(&[String], &[Self])>
If this is a HostBlock, return its patterns and inner nodes.
Sourcepub fn as_host_block_mut(&mut self) -> Option<&mut Vec<Self>>
pub fn as_host_block_mut(&mut self) -> Option<&mut Vec<Self>>
If this is a HostBlock, return mutable access to its nodes.
Sourcepub fn as_directive(&self) -> Option<(&str, &str)>
pub fn as_directive(&self) -> Option<(&str, &str)>
If this is a Directive, return its keyword and value.
Sourcepub fn as_directive_mut(&mut self) -> Option<(&mut String, &mut String)>
pub fn as_directive_mut(&mut self) -> Option<(&mut String, &mut String)>
If this is a Directive, return mutable access to its fields.
Trait Implementations§
Source§impl Clone for ConfigNode
impl Clone for ConfigNode
Source§impl Debug for ConfigNode
impl Debug for ConfigNode
Source§impl<'de> Deserialize<'de> for ConfigNode
impl<'de> Deserialize<'de> for ConfigNode
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 ConfigNode
impl RefUnwindSafe for ConfigNode
impl Send for ConfigNode
impl Sync for ConfigNode
impl Unpin for ConfigNode
impl UnsafeUnpin for ConfigNode
impl UnwindSafe for ConfigNode
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