[][src]Trait cast_trait_object::DerivedDynCast

pub trait DerivedDynCast<T: DynCastConfig + Sealed, C: DynCastConfig> {
    pub fn derived_dyn_cast_ref(&self) -> Result<&T::Target, &T::Source>;
pub fn derived_dyn_cast_mut(
        &mut self
    ) -> Result<&mut T::Target, &mut T::Source>;
pub fn derived_dyn_cast_boxed(
        self: Box<Self>
    ) -> Result<Box<T::Target>, Box<T::Source>>;
pub fn derived_dyn_cast_rc(
        self: Rc<Self>
    ) -> Result<Rc<T::Target>, Rc<T::Source>>;
pub fn derived_dyn_cast_arc(
        self: Arc<Self>
    ) -> Result<Arc<T::Target>, Arc<T::Source>>; }

This is an implementation detail for the macros that implement DynCast.

This trait is a copy of the DynCast trait with the difference that the config type (T) is constrained with a sealed trait so that it must be the ConcreteDynCastConfig type.

There is a blanket implementation so that any type that implements this trait also implements DynCast.

This trait is sometimes implemented by macros instead of the DynCast trait. This allows implementing DynCast for traits that have generic type parameters even if the type parameters aren't used by the type that DynCast is implemented for.

Required methods

pub fn derived_dyn_cast_ref(&self) -> Result<&T::Target, &T::Source>[src]

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

pub fn derived_dyn_cast_mut(&mut self) -> Result<&mut T::Target, &mut T::Source>[src]

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

pub fn derived_dyn_cast_boxed(
    self: Box<Self>
) -> Result<Box<T::Target>, Box<T::Source>>
[src]

This is supported on crate feature alloc only.

Cast a boxed trait object to another trait object.

pub fn derived_dyn_cast_rc(
    self: Rc<Self>
) -> Result<Rc<T::Target>, Rc<T::Source>>
[src]

This is supported on crate feature alloc only.

Cast a reference counted trait object to another trait object.

pub fn derived_dyn_cast_arc(
    self: Arc<Self>
) -> Result<Arc<T::Target>, Arc<T::Source>>
[src]

This is supported on crate feature alloc only.

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

Loading content...

Implementors

Loading content...