[][src]Trait traitcast::TraitcastFrom

pub trait TraitcastFrom {
    fn as_any_ref(&self) -> &(dyn Any + 'static);
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static);
fn as_any_box(self: Box<Self>) -> Box<dyn Any + 'static>; fn type_id(&self) -> TypeId { ... } }

Subtraits of TraitcastFrom may be cast into dyn Any, and thus may be cast into any other castable dynamic trait object, too. This is blanket implemented for all sized types with static lifetimes.

Required methods

fn as_any_ref(&self) -> &(dyn Any + 'static)

Cast to an immutable reference to a trait object.

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Cast to a mutable reference to a trait object.

fn as_any_box(self: Box<Self>) -> Box<dyn Any + 'static>

Cast to a boxed reference to a trait object.

Loading content...

Provided methods

fn type_id(&self) -> TypeId

Get the trait object's dynamic type id.

Loading content...

Implementations on Foreign Types

impl TraitcastFrom for dyn Any + 'static[src]

fn type_id(&self) -> TypeId[src]

Loading content...

Implementors

impl<T> TraitcastFrom for T where
    T: 'static, 
[src]

Blanket implementation that automatically implements TraitcastFrom for most user-defined types.

fn type_id(&self) -> TypeId[src]

Loading content...