CoerceFrom

Trait CoerceFrom 

Source
pub trait CoerceFrom<T> {
    // Required methods
    fn coerce_rc(from: Rc<T>) -> Rc<Self>;
    fn coerce_box(from: Box<T>) -> Box<Self>;
    fn coerce_ref(from: &T) -> &Self;
    fn coerce_mut(from: &mut T) -> &mut Self;
}
Expand description

Stable workaround for CoerceUnsized

Required Methods§

Source

fn coerce_rc(from: Rc<T>) -> Rc<Self>

Source

fn coerce_box(from: Box<T>) -> Box<Self>

Source

fn coerce_ref(from: &T) -> &Self

Source

fn coerce_mut(from: &mut T) -> &mut Self

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§