pub trait Downcast: Sized {
// Required method
fn downcast<T>(&self) -> Option<T>
where T: DowncastFrom<Self>;
// Provided method
fn is_a<T>(&self) -> bool
where T: DowncastFrom<Self> { ... }
}
Expand description
This is the convenience trait whose method you should call to do a downcast.
Required Methods§
fn downcast<T>(&self) -> Option<T>where
T: DowncastFrom<Self>,
Provided Methods§
fn is_a<T>(&self) -> boolwhere
T: DowncastFrom<Self>,
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.