pub trait DowncastFrom<T>: Sized {
// Required method
fn downcast_from(t: &T) -> Option<Self>;
}
Expand description
Our version of “try-from”. A “downcast” casts from a more general type (e.g., any Parameter) to a more specific type (e.g., a type). This returns an Option because the value may not be an instance of the more specific type.
Required Methods§
fn downcast_from(t: &T) -> Option<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.