pub trait Castable: NativeObject {
// Provided methods
fn is<T>(&self) -> bool
where T: NativeObject { ... }
fn upcast<T: Castable>(&self) -> &T
where Self: DerivedFrom<T> { ... }
fn downcast<T>(&self) -> Option<&T>
where T: DerivedFrom<Self> + NativeObject { ... }
}Provided Methods§
fn is<T>(&self) -> boolwhere
T: NativeObject,
fn upcast<T: Castable>(&self) -> &Twhere
Self: DerivedFrom<T>,
fn downcast<T>(&self) -> Option<&T>where
T: DerivedFrom<Self> + NativeObject,
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.