pub enum Mutation {
Show 16 variants
PushId {
id: ElementId,
},
SetId {
id: ElementId,
},
Child {
index: usize,
},
Pop,
CreateElement {
tag: String,
ns: Option<String>,
},
CreateText {
value: String,
},
Clone,
AppendChildren {
m: usize,
},
ReplaceWith {
m: usize,
},
InsertAfter {
m: usize,
},
InsertBefore {
m: usize,
},
SetAttribute {
name: String,
ns: Option<String>,
value: AttributeValue,
},
SetText {
value: String,
},
NewEventListener {
name: String,
},
RemoveEventListener {
name: String,
},
Remove,
}Expand description
A Mutation represents a single instruction for the renderer to use to modify the UI tree to match the state
of the Dioxus VirtualDom.
These edits can be serialized and sent over the network or through any interface
Variants§
PushId
Push the node registered to an element id onto the stack.
SetId
Register the top stack node to an element id, leaving it on the stack.
Child
Replace the top stack node with its child at index.
Pop
Pop and discard the top stack node.
CreateElement
Create an element and push it onto the stack.
CreateText
Create a text node and push it onto the stack.
Clone
Replace the top stack node with a deep clone of itself.
AppendChildren
Append the top m nodes to the parent below them.
ReplaceWith
Replace the target below the top m nodes with those nodes.
InsertAfter
Insert the top m nodes after the anchor below them.
InsertBefore
Insert the top m nodes before the anchor below them.
SetAttribute
Set the value of a node’s attribute.
Fields
ns: Option<String>The (optional) namespace of the attribute. For instance, “style” is in the “style” namespace.
value: AttributeValueThe value of the attribute.
SetText
Set the textcontent of a node.
NewEventListener
Create a new Event Listener.
RemoveEventListener
Remove an existing Event Listener.
Remove
Remove the top stack node from the renderer tree.