pub enum ConfigNode {
Number(String, String),
Boolean(String, String),
String(String, String),
Section(String, Vec<ConfigNode>),
Host(String, Vec<ConfigNode>),
Route(String, Vec<ConfigNode>),
}Expand description
Represents a node in the configuration syntax tree.
Variants§
Number(String, String)
A node that contains a number.
Boolean(String, String)
A node that contains a boolean.
String(String, String)
A node that contains a string.
Section(String, Vec<ConfigNode>)
A node that represents a section and contains a number of child nodes.
Host(String, Vec<ConfigNode>)
A node that represents a host’s configuration and contains a number of child nodes.
Route(String, Vec<ConfigNode>)
A node that represents a route’s configuration and contains a number of child nodes.
Implementations§
Source§impl ConfigNode
impl ConfigNode
Sourcepub fn flatten(&self, hashmap: &mut HashMap<String, Self>, level: &[&str])
pub fn flatten(&self, hashmap: &mut HashMap<String, Self>, level: &[&str])
Flatten this node and all child nodes into a hashmap.
Sourcepub fn get_routes(&self) -> Vec<(String, HashMap<String, Self>)>
pub fn get_routes(&self) -> Vec<(String, HashMap<String, Self>)>
Get the routes configured under this node.
Sourcepub fn get_plugins(&self) -> Vec<(String, HashMap<String, Self>)>
pub fn get_plugins(&self) -> Vec<(String, HashMap<String, Self>)>
Get the plugins configured under this node.
Sourcepub fn get_string(&self) -> Option<String>
pub fn get_string(&self) -> Option<String>
Get this node’s value as a string, or None if this is not possible.
Trait Implementations§
Source§impl Clone for ConfigNode
impl Clone for ConfigNode
Source§fn clone(&self) -> ConfigNode
fn clone(&self) -> ConfigNode
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 ConfigNode
impl Debug for ConfigNode
Source§impl PartialEq for ConfigNode
impl PartialEq for ConfigNode
impl Eq for ConfigNode
impl StructuralPartialEq for ConfigNode
Auto Trait Implementations§
impl Freeze for ConfigNode
impl RefUnwindSafe for ConfigNode
impl Send for ConfigNode
impl Sync for ConfigNode
impl Unpin 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