Skip to main content

Mutation

Enum Mutation 

Source
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.

Fields

§id: ElementId

The renderer-local element id to read.

§

SetId

Register the top stack node to an element id, leaving it on the stack.

Fields

§id: ElementId

The renderer-local element id to write.

§

Child

Replace the top stack node with its child at index.

Fields

§index: usize

The child index to select.

§

Pop

Pop and discard the top stack node.

§

CreateElement

Create an element and push it onto the stack.

Fields

§tag: String

The element tag name.

§ns: Option<String>

The optional element namespace.

§

CreateText

Create a text node and push it onto the stack.

Fields

§value: String

The text node value.

§

Clone

Replace the top stack node with a deep clone of itself.

§

AppendChildren

Append the top m nodes to the parent below them.

Fields

§m: usize

The number of child nodes to append.

§

ReplaceWith

Replace the target below the top m nodes with those nodes.

Fields

§m: usize

The number of replacement nodes.

§

InsertAfter

Insert the top m nodes after the anchor below them.

Fields

§m: usize

The number of inserted nodes.

§

InsertBefore

Insert the top m nodes before the anchor below them.

Fields

§m: usize

The number of inserted nodes.

§

SetAttribute

Set the value of a node’s attribute.

Fields

§name: String

The name of the attribute to set.

§ns: Option<String>

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

§value: AttributeValue

The value of the attribute.

§

SetText

Set the textcontent of a node.

Fields

§value: String

The textcontent of the node

§

NewEventListener

Create a new Event Listener.

Fields

§name: String

The name of the event to listen for.

§

RemoveEventListener

Remove an existing Event Listener.

Fields

§name: String

The name of the event to remove.

§

Remove

Remove the top stack node from the renderer tree.

Trait Implementations§

Source§

impl Debug for Mutation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Mutation

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Mutation

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<Ret> SpawnIfAsync<(), Ret> for Ret

Source§

fn spawn(self) -> Ret

Spawn the value into the dioxus runtime if it is an async block
Source§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

Source§

fn super_from(input: T) -> O

Convert from a type to another type.
Source§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

Source§

fn super_into(self) -> O

Convert from a type to another type.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more