[][src]Trait maomi::component::Component

pub trait Component<B: Backend>: ComponentTemplate<B> + Downcast {
    fn new(_ctx: ComponentContext<B, Self>) -> Self
    where
        Self: Sized
; fn created(&mut self) { ... }
fn attached(&mut self) { ... }
fn moved(&mut self) { ... }
fn detached(&mut self) { ... } }

Required methods

fn new(_ctx: ComponentContext<B, Self>) -> Self where
    Self: Sized

Loading content...

Provided methods

fn created(&mut self)

fn attached(&mut self)

fn moved(&mut self)

fn detached(&mut self)

Loading content...

Methods

impl<B> dyn Component<B> where
    B: Any + 'static,
    B: Backend

pub fn is<__T: Component<B>>(&self) -> bool

Returns true if the trait object wraps an object of type __T.

pub fn downcast<__T: Component<B>>(
    self: Box<Self>
) -> Result<Box<__T>, Box<Self>>

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn't.

pub fn downcast_rc<__T: Component<B>>(
    self: Rc<Self>
) -> Result<Rc<__T>, Rc<Self>>

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn't.

pub fn downcast_ref<__T: Component<B>>(&self) -> Option<&__T>

Returns a reference to the object within the trait object if it is of type __T, or None if it isn't.

pub fn downcast_mut<__T: Component<B>>(&mut self) -> Option<&mut __T>

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn't.

Implementors

impl<B: Backend> Component<B> for EmptyComponent[src]

Loading content...