Trait intertrait::CastFrom[][src]

pub trait CastFrom: Any + 'static {
    fn ref_any(&self) -> &dyn Any;
fn mut_any(&mut self) -> &mut dyn Any;
fn box_any(self: Box<Self>) -> Box<dyn Any>;
fn rc_any(self: Rc<Self>) -> Rc<dyn Any>; }
Expand description

CastFrom must be extended by a trait that wants to allow for casting into another trait.

It is used for obtaining a trait object for Any from a trait object for its sub-trait, and blanket implemented for all Sized + Any + 'static types.

Examples

trait Source: CastFrom {
    ...
}

Required methods

Returns a immutable reference to Any, which is backed by the type implementing this trait.

Returns a mutable reference to Any, which is backed by the type implementing this trait.

Returns a Box of Any, which is backed by the type implementing this trait.

Returns an Rc of Any, which is backed by the type implementing this trait.

Implementations on Foreign Types

Implementors