[−][src]Struct dodrio::VdomWeak
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]
self,
root: Box<dyn RootRender>
) -> impl Future<Item = Box<dyn RootRender + 'static>, Error = VdomDroppedError>
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]
&self,
f: F
) -> impl Future<Item = T, Error = VdomDroppedError> where
F: 'static + FnOnce(&mut dyn RootRender) -> T,
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(&self) -> 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
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,