pub trait ObjectRcUtils {
// Required methods
fn try_downcast<T>(&self) -> Option<Rc<T>>
where T: ConcreteObject;
fn downcast<T>(&self) -> Rc<T>
where T: ConcreteObject;
}Expand description
Utilities for Rc<dyn Object>.
Required Methods§
Sourcefn try_downcast<T>(&self) -> Option<Rc<T>>where
T: ConcreteObject,
fn try_downcast<T>(&self) -> Option<Rc<T>>where
T: ConcreteObject,
Tries to downcast the object to a ConcreteObject.
Sourcefn downcast<T>(&self) -> Rc<T>where
T: ConcreteObject,
fn downcast<T>(&self) -> Rc<T>where
T: ConcreteObject,
Downcasts the object to a ConcreteObject.
This function panics if the object has a different interface.
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.