CoerceTo

Trait CoerceTo 

Source
pub trait CoerceTo<T: ?Sized> {
    // Required methods
    fn coerce_rc_to(self: Rc<Self>) -> Rc<T>;
    fn coerce_box_to(self: Box<Self>) -> Box<T>;
    fn coerce_ref_to(&self) -> &T;
    fn coerce_mut_to(&mut self) -> &mut T;
}
Expand description

Stable workaround for CoerceUnsized

Required Methods§

Source

fn coerce_rc_to(self: Rc<Self>) -> Rc<T>

Source

fn coerce_box_to(self: Box<Self>) -> Box<T>

Source

fn coerce_ref_to(&self) -> &T

Source

fn coerce_mut_to(&mut self) -> &mut T

Implementors§

Source§

impl<T, X> CoerceTo<T> for X
where T: CoerceFrom<X> + ?Sized,