[][src]Trait dodrio::RootRender

pub trait RootRender: Any + for<'a> Render<'a> {
    fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any; }

A RootRender is a render component that can be the root rendering component mounted to a virtual DOM.

In addition to rendering, it must also be 'static so that it can be owned by the virtual DOM and Any so that it can be downcast to its concrete type by event listener callbacks.

You do not need to implement this trait by hand: there is a blanket implementation for all Render types that fulfill the RootRender requirements.

Required methods

fn as_any(&self) -> &dyn Any

Get this &RootRender trait object as an &Any trait object reference.

fn as_any_mut(&mut self) -> &mut dyn Any

Get this &mut RootRender trait object as an &mut Any trait object reference.

Loading content...

Implementations

impl dyn RootRender[src]

pub fn unwrap_ref<R>(&self) -> &R where
    R: RootRender
[src]

Downcast this shared &dyn RootRender trait object reference to its underlying concrete type.

Panics

Panics if this virtual DOM's root rendering component is not an R instance.

pub fn unwrap_mut<R>(&mut self) -> &mut R where
    R: RootRender
[src]

Downcast this exclusive &mut dyn RootRender trait object reference to its underlying concrete type.

Panics

Panics if this virtual DOM's root rendering component is not an R instance.

Implementors

impl<T> RootRender for T where
    T: Any + for<'a> Render<'a>, 
[src]

Loading content...