Trait downcast::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,