pub enum ConfigNode {
Table(BTreeMap<String, ConfigNode>),
Array(Vec<ConfigNode>),
Scalar(String),
Null,
}Expand description
Representation of a configuration tree.
Variants§
Implementations§
Source§impl ConfigNode
impl ConfigNode
Sourcepub fn empty_table() -> Self
pub fn empty_table() -> Self
Create an empty table node.
Sourcepub fn as_table(&self) -> Option<&BTreeMap<String, ConfigNode>>
pub fn as_table(&self) -> Option<&BTreeMap<String, ConfigNode>>
Returns a reference to the underlying map when the node is a table.
Sourcepub fn to_owned_table(
&self,
) -> Result<BTreeMap<String, ConfigNode>, ConfigError>
pub fn to_owned_table( &self, ) -> Result<BTreeMap<String, ConfigNode>, ConfigError>
Returns a mutable copy of the table content.
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 Display for ConfigNode
impl Display for ConfigNode
Source§impl FromNode for ConfigNode
impl FromNode for ConfigNode
fn from_node(node: &ConfigNode, _key: &str) -> Result<Self, ConfigError>
Source§impl PartialEq for ConfigNode
impl PartialEq 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