downcast

Trait Any

Source
pub trait Any: StdAny {
    // Provided method
    fn type_id_compat(&self) -> TypeId { ... }
}

Provided Methods§

Source

fn type_id_compat(&self) -> TypeId

TODO: once 1.33.0 is the minimum supported compiler version, remove Any::type_id_compat and use StdAny::type_id instead. https://github.com/rust-lang/rust/issues/27745

Trait Implementations§

Source§

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

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>>>

Source§

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

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>>>

Source§

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

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>>>

Source§

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

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>>>

Implementors§

Source§

impl<T> Any for T
where T: StdAny + ?Sized,