Struct kdl::KdlNode [−][src]
pub struct KdlNode { pub name: String, pub values: Vec<KdlValue>, pub properties: HashMap<String, KdlValue>, pub children: Vec<KdlNode>, }
A node representing the smallest unit of a KDL document.
The anatomy of a node:
name "value" property_key="property value" {
child
}
Example
use kdl::{KdlNode, KdlValue}; use std::collections::HashMap; const DOCUMENT: &str = r#" name "value" property_key="property value" { child } "#; assert_eq!( kdl::parse_document(DOCUMENT).unwrap(), vec![ KdlNode { name: String::from("name"), values: vec![KdlValue::String("value".into())], properties: { let mut temp = HashMap::new(); temp.insert( String::from("property_key"), KdlValue::String("property value".into()) ); temp }, children: vec![ KdlNode { name: String::from("child"), ..Default::default() } ], } ] )
Fields
name: String
values: Vec<KdlValue>
properties: HashMap<String, KdlValue>
children: Vec<KdlNode>
Trait Implementations
impl StructuralPartialEq for KdlNode
[src]
Auto Trait Implementations
impl RefUnwindSafe for KdlNode
impl Send for KdlNode
impl Sync for KdlNode
impl Unpin for KdlNode
impl UnwindSafe for KdlNode
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more