Trait downcast_rs::Downcast [−][src]
pub trait Downcast: Any { fn into_any(self: Box<Self>) -> Box<Any>; fn as_any(&self) -> &Any; fn as_any_mut(&mut self) -> &mut Any; }
Supports conversion to Any. Traits to be extended by impl_downcast! must extend Downcast.
Required Methods
fn into_any(self: Box<Self>) -> Box<Any>
Convert Box<Trait> (where Trait: Downcast) to Box<Any>. Box<Any> can then be
further downcast into Box<ConcreteType> where ConcreteType implements Trait.
fn as_any(&self) -> &Any
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any's vtable from &Trait's.
fn as_any_mut(&mut self) -> &mut Any
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any's vtable from &mut Trait's.
Implementors
impl<T: Any> Downcast for T