Skip to main content

AdapterUpcast

Trait AdapterUpcast 

Source
pub unsafe trait AdapterUpcast<T>: QRustProxy {
    // Required method
    fn upcast(rc: Rc<RefCell<T>>) -> Rc<RefCell<Self::AdapterType>>;
}
Expand description

Coerces a concrete user type into the proxy’s type-erased adapter handle.

Implemented once per interface.

§Safety

upcast must return the allocation it was passed (an unsizing coercion): callers reinterpret the adapter handle back as Rc<RefCell<T>>.

Required Methods§

Source

fn upcast(rc: Rc<RefCell<T>>) -> Rc<RefCell<Self::AdapterType>>

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.

Implementors§