Trait downcast::Downcast

source ·
pub trait Downcast<T>: Anywhere
    T: Any,{
    // Provided methods
    fn is_type(&self) -> bool { ... }
    fn downcast_ref(&self) -> Result<&T, TypeMismatch> { ... }
    fn downcast_mut(&mut self) -> Result<&mut T, TypeMismatch> { ... }
    fn downcast(self: Box<Self>) -> Result<Box<T>, DowncastError<Box<Self>>> { ... }
    fn downcast_rc(self: Rc<Self>) -> Result<Rc<T>, DowncastError<Rc<Self>>> { ... }
}

Provided Methods§

source

fn is_type(&self) -> bool

source

fn downcast_ref(&self) -> Result<&T, TypeMismatch>

source

fn downcast_mut(&mut self) -> Result<&mut T, TypeMismatch>

source

fn downcast(self: Box<Self>) -> Result<Box<T>, DowncastError<Box<Self>>>

source

fn downcast_rc(self: Rc<Self>) -> Result<Rc<T>, DowncastError<Rc<Self>>>

Implementors§

source§

impl<_T> Downcast<_T> for dyn Any + Sendwhere _T: Any,

source§

impl<_T> Downcast<_T> for dyn Any + Syncwhere _T: Any,

source§

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

source§

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