ObjectRcUtils

Trait ObjectRcUtils 

Source
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§

Source

fn try_downcast<T>(&self) -> Option<Rc<T>>
where T: ConcreteObject,

Tries to downcast the object to a ConcreteObject.

Source

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.

Implementations on Foreign Types§

Source§

impl ObjectRcUtils for Rc<dyn Object>

Source§

fn try_downcast<T>(&self) -> Option<Rc<T>>
where T: ConcreteObject,

Source§

fn downcast<T>(&self) -> Rc<T>
where T: ConcreteObject,

Implementors§