pub enum Node {
Document {
children: Vec<NodeId>,
},
Element {
prefix: String,
local_name: String,
namespace_uri: String,
attributes: Vec<Attribute>,
children: Vec<NodeId>,
namespace_context: HashMap<String, String>,
},
Text {
content: String,
},
Comment {
content: String,
},
ProcessingInstruction {
target: String,
data: Option<String>,
},
}Expand description
Represents an XML node in the document tree.
Variants§
Document
The document root.
Element
An element node.
Fields
Text
A text node.
Comment
A comment node.
ProcessingInstruction
A processing instruction.
Implementations§
Source§impl Node
impl Node
Sourcepub fn children_mut(&mut self) -> Option<&mut Vec<NodeId>>
pub fn children_mut(&mut self) -> Option<&mut Vec<NodeId>>
Returns a mutable reference to the children of this node.
Sourcepub fn is_element(&self) -> bool
pub fn is_element(&self) -> bool
Returns true if this is an element node.
Sourcepub fn is_comment(&self) -> bool
pub fn is_comment(&self) -> bool
Returns true if this is a comment node.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin 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