Trait downcast::Any

source ·
pub trait Any: StdAny {
    // Required method
    fn type_name(&self) -> &'static str;
}

Required Methods§

source

fn type_name(&self) -> &'static str

Implementations§

source§

impl dyn Any

source

pub fn is<_T>(&self) -> bool
where _T: Any, Self: Downcast<_T>,

source

pub fn downcast_ref<_T>(&self) -> Result<&_T, TypeMismatch>
where _T: Any, Self: Downcast<_T>,

source

pub fn downcast_mut<_T>(&mut self) -> Result<&mut _T, TypeMismatch>
where _T: Any, Self: Downcast<_T>,

source

pub fn downcast<_T>( self: Box<Self>, ) -> Result<Box<_T>, DowncastError<Box<Self>>>
where _T: Any, Self: Downcast<_T>,

source

pub fn downcast_rc<_T>( self: Rc<Self>, ) -> Result<Rc<_T>, DowncastError<Rc<Self>>>
where _T: Any, Self: Downcast<_T>,

source§

impl dyn Any + Send

source

pub fn is<_T>(&self) -> bool
where _T: Any, Self: Downcast<_T>,

source

pub fn downcast_ref<_T>(&self) -> Result<&_T, TypeMismatch>
where _T: Any, Self: Downcast<_T>,

source

pub fn downcast_mut<_T>(&mut self) -> Result<&mut _T, TypeMismatch>
where _T: Any, Self: Downcast<_T>,

source

pub fn downcast<_T>( self: Box<Self>, ) -> Result<Box<_T>, DowncastError<Box<Self>>>
where _T: Any, Self: Downcast<_T>,

source

pub fn downcast_rc<_T>( self: Rc<Self>, ) -> Result<Rc<_T>, DowncastError<Rc<Self>>>
where _T: Any, Self: Downcast<_T>,

source§

impl dyn Any + Sync

source

pub fn is<_T>(&self) -> bool
where _T: Any, Self: Downcast<_T>,

source

pub fn downcast_ref<_T>(&self) -> Result<&_T, TypeMismatch>
where _T: Any, Self: Downcast<_T>,

source

pub fn downcast_mut<_T>(&mut self) -> Result<&mut _T, TypeMismatch>
where _T: Any, Self: Downcast<_T>,

source

pub fn downcast<_T>( self: Box<Self>, ) -> Result<Box<_T>, DowncastError<Box<Self>>>
where _T: Any, Self: Downcast<_T>,

source

pub fn downcast_rc<_T>( self: Rc<Self>, ) -> Result<Rc<_T>, DowncastError<Rc<Self>>>
where _T: Any, Self: Downcast<_T>,

Trait Implementations§

source§

impl<_T> Downcast<_T> for dyn Any
where _T: Any,

source§

impl<_T> Downcast<_T> for dyn Any + Send
where _T: Any,

source§

impl<_T> Downcast<_T> for dyn Any + Sync
where _T: Any,

Implementors§

source§

impl<T> Any for T
where T: StdAny,