Trait downcast::Downcast

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

Provided Methods§

source

fn is_type(&self) -> bool

source

unsafe fn downcast_ref_unchecked(&self) -> &T

source

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

source

unsafe fn downcast_mut_unchecked(&mut self) -> &mut T

source

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

source

unsafe fn downcast_unchecked(self: Box<Self>) -> Box<T>

source

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

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<_T> Downcast<_T> for dyn Any + Send + Sync
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,

source§

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