pub struct Node<'a> { /* private fields */ }Expand description
A virtual DOM node.
Implementations§
Source§impl<'a> Node<'a>
impl<'a> Node<'a>
Sourcepub fn element(
bump: &'a Bump,
key: NodeKey,
tag_name: &'a str,
listeners: &'a [Listener<'a>],
attributes: &'a [Attribute<'a>],
children: &'a [Node<'a>],
namespace: Option<&'a str>,
) -> Node<'a>
pub fn element( bump: &'a Bump, key: NodeKey, tag_name: &'a str, listeners: &'a [Listener<'a>], attributes: &'a [Attribute<'a>], children: &'a [Node<'a>], namespace: Option<&'a str>, ) -> Node<'a>
Low-level constructor for making a new Node of type element with given
parts.
This is primarily intended for JSX and templating proc-macros to compile
down into. If you are building nodes by-hand, prefer using the
dodrio::builder::* APIs.
Trait Implementations§
Source§impl<'a> IntoIterator for Node<'a>
A node can become an iterator that yields the node itself once.
impl<'a> IntoIterator for Node<'a>
A node can become an iterator that yields the node itself once.
This implementation of IntoIterator mostly exists to improve the
typed-html ergonomics, where the macro invokes .into_iter() on the child
contents of a tag. By implementing IntoIterator here, we avoid having to
do nasty shenanigans like <p>vec![$contents]</p> instead of plain old
<p>$contents</p>.
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