pub trait AnyExt: Any {
// Provided methods
fn is<T: Any + ?Sized>(&self) -> bool { ... }
fn downcast_ref<T: Any>(&self) -> Option<&T> { ... }
fn downcast_mut<T: Any>(&mut self) -> Option<&mut T> { ... }
}Expand description
Extension of Any for using its methods directly on the value without dyn.
Provided Methods§
Sourcefn downcast_ref<T: Any>(&self) -> Option<&T>
fn downcast_ref<T: Any>(&self) -> Option<&T>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.