Trait dyn_any::Upcast

source ·
pub trait Upcast<U: ?Sized> {
    // Required methods
    fn up(&self) -> &U;
    fn up_mut(&mut self) -> &mut U;
    fn up_box(self: Box<Self>) -> Box<U>;
}
Expand description

Use this trait to perform your upcasts on dyn traits. Make sure to require it in the supertrait!

Required Methods§

source

fn up(&self) -> &U

source

fn up_mut(&mut self) -> &mut U

source

fn up_box(self: Box<Self>) -> Box<U>

Implementors§

source§

impl<T: ?Sized, U> Upcast<U> for Twhere U: UpcastFrom<T> + ?Sized,