Struct dioxus_core::dodriodiff::DiffMachine[][src]

pub struct DiffMachine<'a> {
    pub change_list: EditMachine<'a>,
    // some fields omitted
}

The DiffState is a cursor internal to the VirtualDOM’s diffing algorithm that allows persistence of state while diffing trees of components. This means we can “re-enter” a subtree of a component by queuing a “NeedToDiff” event.

By re-entering via NodeDiff, we can connect disparate edits together into a single EditList. This batching of edits leads to very fast re-renders (all done in a single animation frame).

It also means diffing two trees is only ever complex as diffing a single smaller tree, and then re-entering at a different cursor position.

The order of these re-entrances is stored in the DiffState itself. The DiffState comes pre-loaded with a set of components that were modified by the eventtrigger. This prevents doubly evaluating components if they wereboth updated via subscriptions and props changes.

Fields

change_list: EditMachine<'a>

Implementations

impl<'a> DiffMachine<'a>[src]

pub fn new(bump: &'a Bump) -> Self[src]

pub fn consume(self) -> EditList<'a>[src]

pub fn diff_node(
    &mut self,
    old: &VNode<'a>,
    new: &VNode<'a>,
    scope: Option<Index>
)
[src]

pub fn remove_all_children(&mut self, old: &[VNode<'a>])[src]

pub fn create_and_append_children(&mut self, new: &[VNode<'a>])[src]

pub fn remove_self_and_next_siblings(&mut self, old: &[VNode<'a>])[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for DiffMachine<'a>

impl<'a> Send for DiffMachine<'a>

impl<'a> Sync for DiffMachine<'a>

impl<'a> Unpin for DiffMachine<'a>

impl<'a> UnwindSafe for DiffMachine<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.