Trait otter_api_tests::imports::cast_trait_object::DynCast[]

pub trait DynCast<T> where
    T: DynCastConfig
{ pub fn dyn_cast_ref(
        &self
    ) -> Result<&<T as DynCastConfig>::Target, &<T as DynCastConfig>::Source>;
pub fn dyn_cast_mut(
        &mut self
    ) -> Result<&mut <T as DynCastConfig>::Target, &mut <T as DynCastConfig>::Source>;
pub fn dyn_cast_boxed(
        self: Box<Self, Global>
    ) -> Result<Box<<T as DynCastConfig>::Target, Global>, Box<<T as DynCastConfig>::Source, Global>>;
pub fn dyn_cast_rc(
        self: Rc<Self>
    ) -> Result<Rc<<T as DynCastConfig>::Target>, Rc<<T as DynCastConfig>::Source>>;
pub fn dyn_cast_arc(
        self: Arc<Self>
    ) -> Result<Arc<<T as DynCastConfig>::Target>, Arc<<T as DynCastConfig>::Source>>; }

Cast a trait object (T::Source) into a different trait object (T::Target).

This trait is object safe and provides methods to convert from one fat pointer to another. This can be used as a supertrait or via trait bounds to allow casting between two different trait objects. But for usage it is more ergonomic to use the methods that are provided by the DynCastExt trait than to call the methods on this trait directly.

Required methods

pub fn dyn_cast_ref(
    &self
) -> Result<&<T as DynCastConfig>::Target, &<T as DynCastConfig>::Source>

Cast a shared reference of this trait object to another trait object.

pub fn dyn_cast_mut(
    &mut self
) -> Result<&mut <T as DynCastConfig>::Target, &mut <T as DynCastConfig>::Source>

Cast a mutable/unique reference of this trait object to another trait object.

pub fn dyn_cast_boxed(
    self: Box<Self, Global>
) -> Result<Box<<T as DynCastConfig>::Target, Global>, Box<<T as DynCastConfig>::Source, Global>>

Cast a boxed trait object to another trait object.

pub fn dyn_cast_rc(
    self: Rc<Self>
) -> Result<Rc<<T as DynCastConfig>::Target>, Rc<<T as DynCastConfig>::Source>>

Cast a reference counted trait object to another trait object.

pub fn dyn_cast_arc(
    self: Arc<Self>
) -> Result<Arc<<T as DynCastConfig>::Target>, Arc<<T as DynCastConfig>::Source>>

Cast an atomically reference counted trait object to another trait object.

Loading content...

Implementors

impl DynCast<<dyn OutlineTrait + 'static as GetDynCastConfig<dyn OutlineTrait + 'static>>::Config> for Outline[src]

impl DynCast<<dyn OutlineTrait + 'static as GetDynCastConfig<dyn OutlineTrait + 'static>>::Config> for Item[src]

impl DynCast<<dyn OutlineTrait + 'static as GetDynCastConfig<dyn OutlineTrait + 'static>>::Config> for CircleShape[src]

impl DynCast<<dyn OutlineTrait + 'static as GetDynCastConfig<dyn OutlineTrait + 'static>>::Config> for RectShape[src]

impl<C, T> DynCast<C> for T where
    C: DynCastConfig,
    T: DerivedDynCast<ConcreteDynCastConfig<<C as DynCastConfig>::Source, <C as DynCastConfig>::Target>, C>, 

Loading content...