pub enum Node<'a> {
Element(Cow<'a, str>, Attrs<'a>),
Comment(Cow<'a, str>),
Doctype(Cow<'a, str>),
TemplateBlock(TemplateBlock<'a>),
Root,
}
Expand description
A node returned by a parser and later stored in a tree.
Variants§
Element(Cow<'a, str>, Attrs<'a>)
Comment(Cow<'a, str>)
Doctype(Cow<'a, str>)
TemplateBlock(TemplateBlock<'a>)
Root
Implementations§
Source§impl<'a> Node<'a>
impl<'a> Node<'a>
Sourcepub fn new_simple_element<S1: Into<Cow<'a, str>>, S2: Into<Cow<'a, str>>, S3: Into<Cow<'a, str>>, I: IntoIterator<Item = (S2, S3)>>(
element_name: S1,
attrs: I,
) -> Self
pub fn new_simple_element<S1: Into<Cow<'a, str>>, S2: Into<Cow<'a, str>>, S3: Into<Cow<'a, str>>, I: IntoIterator<Item = (S2, S3)>>( element_name: S1, attrs: I, ) -> Self
Make a new “simple” element from its name and a list of plain string key/value pairs.
This method does not support using interpreted expressions or statements inside attributes.
pub fn new_element_without_attrs<S: Into<Cow<'a, str>>>(element_name: S) -> Self
pub fn new_comment<S: Into<Cow<'a, str>>>(comment_value: S) -> Self
pub fn new_doctype<S: Into<Cow<'a, str>>>(doctype_value: S) -> Self
Trait Implementations§
impl<'a> StructuralPartialEq for Node<'a>
Auto Trait Implementations§
impl<'a> Freeze for Node<'a>
impl<'a> RefUnwindSafe for Node<'a>
impl<'a> Send for Node<'a>
impl<'a> Sync for Node<'a>
impl<'a> Unpin for Node<'a>
impl<'a> UnwindSafe for Node<'a>
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