[][src]Struct dodrio::Vdom

#[must_use =
  "A `Vdom` will only keep rendering and listening to events while it has not been \
              dropped. If you want a `Vdom` to run forever, call `Vdom::forget`."]pub struct Vdom { /* fields omitted */ }

A strong handle to a mounted virtual DOM.

When this handle is dropped, the virtual DOM is unmounted and its listeners removed. To keep it mounted forever, use the Vdom::forget method.

Implementations

impl Vdom[src]

pub fn new<R>(container: &Element, component: R) -> Vdom where
    R: RootRender
[src]

Mount a new Vdom in the given container element with the given root rendering component.

This will box the given component into trait object.

pub fn with_boxed_root_render(
    container: &Element,
    component: Box<dyn RootRender>
) -> Vdom
[src]

Construct a Vdom with the already-boxed-as-a-trait-object root rendering component.

pub fn forget(self)[src]

Run this virtual DOM and its listeners forever and never unmount it.

pub fn weak(&self) -> VdomWeak[src]

Get a weak handle to this virtual DOM.

pub fn unmount(self) -> Box<dyn RootRender>[src]

Unmount this virtual DOM, unregister its event listeners, and return its root render component.

Trait Implementations

impl Debug for Vdom[src]

Auto Trait Implementations

impl !RefUnwindSafe for Vdom

impl !Send for Vdom

impl !Sync for Vdom

impl Unpin for Vdom

impl !UnwindSafe for Vdom

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.