Struct dioxus_core::Mutations

source ·
pub struct Mutations {
    pub dirty_scopes: FxHashSet<ScopeId>,
    pub templates: Vec<Template>,
    pub edits: Vec<Mutation>,
}
Expand description

A static list of mutations that can be applied to the DOM. Note: this list does not contain any Any attribute values

Fields§

§dirty_scopes: FxHashSet<ScopeId>

The list of Scopes that were diffed, created, and removed during the Diff process.

§templates: Vec<Template>

Any templates encountered while diffing the DOM.

These must be loaded into a cache before applying the edits

§edits: Vec<Mutation>

Any mutations required to patch the renderer to match the layout of the VirtualDom

Implementations§

source§

impl Mutations

source

pub fn santize(self) -> Self

Rewrites IDs to just be “template”, so you can compare the mutations

Used really only for testing

Trait Implementations§

source§

impl Debug for Mutations

source§

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

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

impl Default for Mutations

source§

fn default() -> Mutations

Returns the “default value” for a type. Read more
source§

impl PartialEq for Mutations

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl WriteMutations for Mutations

source§

fn register_template(&mut self, template: Template)

Register a template with the renderer
source§

fn append_children(&mut self, id: ElementId, m: usize)

Add these m children to the target element Read more
source§

fn assign_node_id(&mut self, path: &'static [u8], id: ElementId)

Assign the element at the given path the target ElementId. Read more
source§

fn create_placeholder(&mut self, id: ElementId)

Create a placeholder in the DOM that we will use later. Read more
source§

fn create_text_node(&mut self, value: &str, id: ElementId)

Create a node specifically for text with the given value Read more
source§

fn hydrate_text_node(&mut self, path: &'static [u8], value: &str, id: ElementId)

Hydrate an existing text node at the given path with the given text. Read more
source§

fn load_template(&mut self, name: &'static str, index: usize, id: ElementId)

Load and clone an existing node from a template saved under that specific name Read more
source§

fn replace_node_with(&mut self, id: ElementId, m: usize)

Replace the target element (given by its ID) with the topmost m nodes on the stack Read more
source§

fn replace_placeholder_with_nodes(&mut self, path: &'static [u8], m: usize)

Replace an existing element in the template at the given path with the m nodes on the stack Read more
source§

fn insert_nodes_after(&mut self, id: ElementId, m: usize)

Insert a number of nodes after a given node. Read more
source§

fn insert_nodes_before(&mut self, id: ElementId, m: usize)

Insert a number of nodes before a given node. Read more
source§

fn set_attribute( &mut self, name: &'static str, ns: Option<&'static str>, value: &AttributeValue, id: ElementId )

Set the value of a node’s attribute. Read more
source§

fn set_node_text(&mut self, value: &str, id: ElementId)

Set the text content of a node. Read more
source§

fn create_event_listener(&mut self, name: &'static str, id: ElementId)

Create a new Event Listener. Read more
source§

fn remove_event_listener(&mut self, name: &'static str, id: ElementId)

Remove an existing Event Listener. Read more
source§

fn remove_node(&mut self, id: ElementId)

Remove a particular node from the DOM Read more
source§

fn push_root(&mut self, id: ElementId)

Push the given root node onto our stack. Read more
source§

fn swap_subtree(&mut self, _subtree_index: usize)

Swap to a new subtree
source§

fn mark_scope_dirty(&mut self, scope_id: ScopeId)

Mark a scope as dirty
source§

impl StructuralPartialEq for Mutations

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<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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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