[][src]Struct dodrio::VdomWeak

pub struct VdomWeak { /* fields omitted */ }

A weak handle to a virtual DOM.

Does not prevent the virtual DOM from being unmounted: only keeping the original Vdom alive guarantees that.

A VdomWeak also gives you the capability to scheduling re-rendering (say after mutating the render component state).

Methods

impl VdomWeak[src]

pub fn set_component(
    self,
    root: Box<dyn RootRender>
) -> impl Future<Item = Box<dyn RootRender + 'static>, Error = VdomDroppedError>
[src]

Replace the root rendering component with the new root.

Returns a future that resolves to the old root component.

pub fn with_component<F, T>(
    &self,
    f: F
) -> impl Future<Item = T, Error = VdomDroppedError> where
    F: 'static + FnOnce(&mut dyn RootRender) -> T, 
[src]

Execute f with a reference to this virtual DOM's root rendering component.

To ensure exclusive access to the root rendering component, the invocation takes place on a new tick of the micro-task queue.

pub fn schedule_render(&self)[src]

Schedule a render to occur during the next animation frame.

If you want a future that resolves after the render has finished, use render instead.

pub fn render(&self) -> impl Future<Item = (), Error = VdomDroppedError>[src]

Schedule a render to occur during the next animation frame and return a future that will complete once the render has finished.

If you don't want to do more things after the render completes, then use schedule_render instead of render.

Trait Implementations

impl Clone for VdomWeak[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for VdomWeak[src]

Auto Trait Implementations

impl !Send for VdomWeak

impl !Sync for VdomWeak

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for 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> 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.

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