pub trait DowncastTo<T>: Sized {
// Required method
fn downcast_to(&self) -> Option<T>;
}
Expand description
Our version of “try-into”. A “downcast” casts from a more general type (e.g., any Parameter) to a more specific type (e.g., a type).
This is the trait that you prefer to implement,
but use DowncastFrom
in where-clauses.
Required Methods§
fn downcast_to(&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.