Struct percy_vdom::DomUpdater[][src]

pub struct DomUpdater {
    pub active_closures: HashMap<u32, Vec<DynClosure>>,
    // some fields omitted
}
Expand description

Used for keeping a real DOM node up to date based on the current VirtualNode and a new incoming VirtualNode that represents our latest DOM state.

Fields

active_closures: HashMap<u32, Vec<DynClosure>>

The closures that are currently attached to elements in the page.

We keep these around so that they don’t get dropped (and thus stop working);

FIXME: Drop them when the element is no longer in the page. Need to figure out a good strategy for when to do this.

Implementations

Create a new DomUpdater.

A root Node will be created but not added to your DOM.

Create a new DomUpdater.

A root Node will be created and appended (as a child) to your passed in mount element.

Create a new DomUpdater.

A root Node will be created and it will replace your passed in mount element.

Diff the current virtual dom with the new virtual dom that is being passed in.

Then use that diff to patch the real DOM in the user’s browser so that they are seeing the latest state of the application.

Return the root node of your application, the highest ancestor of all other nodes in your real DOM tree.

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

Performs the conversion.

Performs the conversion.

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.