[][src]Struct sauron::dom::DomUpdater

pub struct DomUpdater {
    pub active_closures: ActiveClosure,
    // some fields omitted
}

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

Fields

active_closures: ActiveClosure

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.

Methods

impl DomUpdater[src]

pub fn new(current_vdom: Node) -> DomUpdater[src]

Create a new DomUpdater.

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

pub fn new_append_to_mount(current_vdom: Node, mount: &Element) -> DomUpdater[src]

Create a new DomUpdater.

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

pub fn new_replace_mount(current_vdom: Node, mount: Element) -> DomUpdater[src]

Create a new DomUpdater.

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

pub fn update(&mut self, new_vdom: Node)[src]

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.

pub fn root_node(&self) -> Node[src]

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

Auto Trait Implementations

impl !Send for DomUpdater

impl !Sync for DomUpdater

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.