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: u64

The ID of the root node to push.

Push the given root node onto our stack.

AppendChildren

Fields

many: u32

How 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: u64

The ID of the node to be replaced.

m: u32

How 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: u64

The ID of the node to insert after.

n: u32

How 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: u64

The ID of the node to insert before.

n: u32

How 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: u64

The ID of the node to remove.

Remove a particular node from the DOM

CreateTextNode

Fields

root: u64

The ID the new node should have.

text: &'bump str

The textcontent of the node

Create a new purely-text node

CreateElement

Fields

root: u64

The ID the new node should have.

tag: &'bump str

The tagname of the node

Create a new purely-element node

CreateElementNs

Fields

root: u64

The ID the new node should have.

tag: &'bump str

The namespace of the node

ns: &'static str

The namespace of the node (like SVG)

Create a new purely-comment node with a given namespace

CreatePlaceholder

Fields

root: u64

The 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 str

The name of the event to listen for.

scope: ScopeId

The ID of the node to attach the listener to.

root: u64

The ID of the node to attach the listener to.

Create a new Event Listener.

RemoveEventListener

Fields

root: u64

The ID of the node to remove.

event: &'static str

The name of the event to remove.

Remove an existing Event Listener.

SetText

Fields

root: u64

The ID of the node to set the textcontent of.

text: &'bump str

The textcontent of the node

Set the textcontent of a node.

SetAttribute

Fields

root: u64

The ID of the node to set the attribute of.

field: &'static str

The name of the attribute to set.

value: &'bump str

The value of the attribute.

ns: Option<&'bump str>

The (optional) namespace of the attribute. For instance, “style” is in the “style” namespace.

Set the value of a node’s attribute.

RemoveAttribute

Fields

root: u64

The ID of the node to remove.

name: &'static str

The name of the attribute to remove.

ns: Option<&'bump str>

The namespace of the attribute.

Remove an attribute from a node.

PopRoot

Fields

Manually pop a root node from the stack.

Trait Implementations

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.