[−][src]Struct sauron::dom::DomUpdater
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<DSP, MSG> DomUpdater<DSP, MSG> where
MSG: 'static,
DSP: Dispatch<MSG> + 'static,
[src]
MSG: 'static,
DSP: Dispatch<MSG> + 'static,
pub fn new(current_vdom: Node<MSG>, root_node: &Node) -> DomUpdater<DSP, MSG>
[src]
Creates and instance of this DOM updater, but doesn't mount the current_vdom to the DOM just yet.
pub fn active_closure_len(&self) -> usize
[src]
count the total active closures regardless of which element it attached to.
pub fn append_to_mount(&mut self, program: &Rc<DSP>)
[src]
Mount the current_vdom appending to the actual browser DOM specified in the root_node This also gets the closures that was created when mounting the vdom to their actual DOM counterparts.
pub fn replace_mount(&mut self, program: &Rc<DSP>)
[src]
Mount the current_vdom replacing the actual browser DOM specified in the root_node This also gets the closures that was created when mounting the vdom to their actual DOM counterparts.
pub fn new_append_to_mount(
program: &Rc<DSP>,
current_vdom: Node<MSG>,
mount: &Element
) -> DomUpdater<DSP, MSG>
[src]
program: &Rc<DSP>,
current_vdom: Node<MSG>,
mount: &Element
) -> DomUpdater<DSP, MSG>
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(
program: &Rc<DSP>,
current_vdom: Node<MSG>,
mount: Element
) -> DomUpdater<DSP, MSG>
[src]
program: &Rc<DSP>,
current_vdom: Node<MSG>,
mount: Element
) -> DomUpdater<DSP, MSG>
Create a new DomUpdater
.
A root Node
will be created and it will replace your passed in mount
element.
pub fn update_dom(&mut self, program: &Rc<DSP>, new_vdom: Node<MSG>)
[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<DSP, MSG> !Sync for DomUpdater<DSP, MSG>
impl<DSP, MSG> !Send for DomUpdater<DSP, MSG>
impl<DSP, MSG> Unpin for DomUpdater<DSP, MSG> where
DSP: Unpin,
DSP: Unpin,
impl<DSP, MSG> !RefUnwindSafe for DomUpdater<DSP, MSG>
impl<DSP, MSG> !UnwindSafe for DomUpdater<DSP, MSG>
Blanket Implementations
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,