Struct dioxus_core::dodriodiff::DiffMachine [−][src]
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]
&mut self,
old: &VNode<'a>,
new: &VNode<'a>,
scope: Option<Index>
)
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,