Struct perseus::HydrateNode [−][src]
pub struct HydrateNode { /* fields omitted */ }
Expand description
Rendering backend for the DOM with hydration support.
This API requires the following crate features to be activated: experimental-hydrate
, dom
Implementations
Trait Implementations
Performs the conversion.
When hydrating, instead of creating a new node, this will attempt to hydrate an existing node.
When hydrating, instead of creating a new node, this will attempt to hydrate an existing node.
Whether this rendering backend needs the hydration registry.
Create a marker (dummy) node. For DomNode
, this is implemented by creating an empty
comment node. This is used, for example, in Keyed
and
Indexed
for scenarios where you want to push a new item to the
end of the list. If the list is empty, a dummy node is needed to store the position of
the component. Read more
Create a marker (dummy) node with text content. For empty marker, prefer
GenericNode::marker
instead. Read more
Sets an attribute on a node.
Removes an attribute on a node.
Sets a property on a node.
Removes a property on a node.
Appends a child to the node’s children.
Get the first child of the node.
pub fn insert_child_before(
&self,
new_node: &HydrateNode,
reference_node: Option<&HydrateNode>
)
pub fn insert_child_before(
&self,
new_node: &HydrateNode,
reference_node: Option<&HydrateNode>
)
Insert a new child node to this node’s children. If reference_node
is Some
, the child
will be inserted before the reference node. Else if None
, the child will be inserted
at the end. Read more
Remove a child node from this node’s children.
Replace a child node from this node’s children with a new child node.
Insert a new node before this node.
Returns the parent node, or None
if detached.
Returns the next sibling, or None
if this node is the last sibling.
Remove this node from the tree.
pub fn event(
&self,
name: &str,
handler: Box<dyn Fn(<HydrateNode as GenericNode>::EventType) + 'static, Global>
)
pub fn event(
&self,
name: &str,
handler: Box<dyn Fn(<HydrateNode as GenericNode>::EventType) + 'static, Global>
)
Add a [EventHandler
] to the event name
.
Update inner text of the node. If the node has elements, all the elements are replaced with a new text node. Read more
Updates the inner html of the node.
The html will not be parsed in non-browser environments. This means that accessing methods
such as first_child
will return None
. Read more
Create a deep clone of the node.
A boolean indicating whether this node is rendered in a browser context. Read more
Auto Trait Implementations
impl !RefUnwindSafe for HydrateNode
impl !Send for HydrateNode
impl !Sync for HydrateNode
impl Unpin for HydrateNode
impl UnwindSafe for HydrateNode
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.