pub struct Node {
pub name: String,
pub value: Value,
pub attributes: Vec<(String, String)>,
pub children: Vec<Node>,
}Expand description
One node: a name, a value, attributes (name, value) and children.
Fields§
§name: StringNode name.
value: ValueNode value.
attributes: Vec<(String, String)>Attributes (name, value), in stored order.
children: Vec<Node>Child nodes, in stored order.
Implementations§
Source§impl Node
impl Node
Sourcepub fn new(name: impl Into<String>, value: Value) -> Self
pub fn new(name: impl Into<String>, value: Value) -> Self
A node without attributes or children.
Sourcepub fn child_mut(&mut self, name: &str) -> Option<&mut Node>
pub fn child_mut(&mut self, name: &str) -> Option<&mut Node>
The first child with this name, mutably.
Trait Implementations§
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
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