Enum html_node_core::Node
source · pub enum Node {
Comment(Comment),
Doctype(Doctype),
Fragment(Fragment),
Element(Element),
Text(Text),
UnsafeText(UnsafeText),
}
Expand description
An HTML node.
Variants§
Comment(Comment)
A comment.
<!-- I'm a comment! -->
Doctype(Doctype)
A doctype.
<!DOCTYPE html>
Fragment(Fragment)
A fragment.
<>
I'm in a fragment!
</>
Element(Element)
An element.
<div class="container">
I'm in an element!
</div>
Text(Text)
A text node.
<div>
I'm a text node!
</div>
UnsafeText(UnsafeText)
An unsafe text node.
Warning
Node::UnsafeText
is not escaped when rendered, and as such, can
allow for XSS attacks. Use with caution!
Implementations§
source§impl Node
impl Node
sourcepub const NULL: Self = _
pub const NULL: Self = _
A Node::Fragment
with no children.
sourcepub fn from_typed<E: TypedElement>(
element: E,
children: Option<Vec<Self>>
) -> Self
pub fn from_typed<E: TypedElement>( element: E, children: Option<Vec<Self>> ) -> Self
Create a new Node
from a TypedElement
.
Trait Implementations§
source§impl<I> From<I> for Nodewhere
I: IntoIterator<Item = Self>,
impl<I> From<I> for Nodewhere I: IntoIterator<Item = Self>,
source§impl PartialEq<Node> for Node
impl PartialEq<Node> for Node
impl Eq for Node
impl StructuralEq for Node
impl StructuralPartialEq for Node
Auto Trait Implementations§
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