Enum dioxus_core::DomEdit
source · [−]pub enum DomEdit<'bump> {
Show 16 variants
PushRoot {
root: u64,
},
AppendChildren {
many: u32,
},
ReplaceWith {
root: u64,
m: u32,
},
InsertAfter {
root: u64,
n: u32,
},
InsertBefore {
root: u64,
n: u32,
},
Remove {
root: u64,
},
CreateTextNode {
root: u64,
text: &'bump str,
},
CreateElement {
root: u64,
tag: &'bump str,
},
CreateElementNs {
root: u64,
tag: &'bump str,
ns: &'static str,
},
CreatePlaceholder {
root: u64,
},
NewEventListener {
event_name: &'static str,
scope: ScopeId,
root: u64,
},
RemoveEventListener {
root: u64,
event: &'static str,
},
SetText {
root: u64,
text: &'bump str,
},
SetAttribute {
root: u64,
field: &'static str,
value: &'bump str,
ns: Option<&'bump str>,
},
RemoveAttribute {
root: u64,
name: &'static str,
ns: Option<&'bump str>,
},
PopRoot {},
}Expand description
A DomEdit represents a serialized form of the VirtualDom’s trait-based API. This allows streaming edits across the
network or through FFI boundaries.
Variants
PushRoot
Fields
root: u64The ID of the root node to push.
Push the given root node onto our stack.
AppendChildren
Fields
many: u32How many nodes should be popped from the stack. The node remaining on the stack will be the target for the append.
Pop the topmost node from our stack and append them to the node at the top of the stack.
ReplaceWith
Fields
root: u64The ID of the node to be replaced.
m: u32How many nodes should be popped from the stack to replace the target node.
Replace a given (single) node with a handful of nodes currently on the stack.
InsertAfter
Fields
root: u64The ID of the node to insert after.
n: u32How many nodes should be popped from the stack to insert after the target node.
Insert a number of nodes after a given node.
InsertBefore
Fields
root: u64The ID of the node to insert before.
n: u32How many nodes should be popped from the stack to insert before the target node.
Insert a number of nodes before a given node.
Remove
Fields
root: u64The ID of the node to remove.
Remove a particular node from the DOM
CreateTextNode
Create a new purely-text node
CreateElement
Create a new purely-element node
CreateElementNs
Fields
root: u64The ID the new node should have.
tag: &'bump strThe namespace of the node
ns: &'static strThe namespace of the node (like SVG)
Create a new purely-comment node with a given namespace
CreatePlaceholder
Fields
root: u64The ID the new node should have.
Create a new placeholder node. In most implementations, this will either be a hidden div or a comment node.
NewEventListener
Fields
event_name: &'static strThe name of the event to listen for.
scope: ScopeIdThe ID of the node to attach the listener to.
root: u64The ID of the node to attach the listener to.
Create a new Event Listener.
RemoveEventListener
Remove an existing Event Listener.
SetText
Fields
root: u64The ID of the node to set the textcontent of.
text: &'bump strThe textcontent of the node
Set the textcontent of a node.
SetAttribute
Fields
root: u64The ID of the node to set the attribute of.
field: &'static strThe name of the attribute to set.
value: &'bump strThe value of the attribute.
Set the value of a node’s attribute.
RemoveAttribute
Remove an attribute from a node.
PopRoot
Fields
Manually pop a root node from the stack.
Trait Implementations
impl<'bump> StructuralPartialEq for DomEdit<'bump>
Auto Trait Implementations
impl<'bump> RefUnwindSafe for DomEdit<'bump>
impl<'bump> Send for DomEdit<'bump>
impl<'bump> Sync for DomEdit<'bump>
impl<'bump> Unpin for DomEdit<'bump>
impl<'bump> UnwindSafe for DomEdit<'bump>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more