[−][src]Trait intertrait::CastFrom
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
ⓘThis example is not tested
trait Source: CastFrom { ... }
Required methods
fn ref_any(&self) -> &dyn Any
Returns a immutable reference to Any
, which is backed by the type implementing this trait.
fn mut_any(&mut self) -> &mut dyn Any
Returns a mutable reference to Any
, which is backed by the type implementing this trait.
fn box_any(self: Box<Self>) -> Box<dyn Any>
Returns a Box
of Any
, which is backed by the type implementing this trait.
fn rc_any(self: Rc<Self>) -> Rc<dyn Any>
Returns an Rc
of Any
, which is backed by the type implementing this trait.