Trait otter_api_tests::imports::cast_trait_object::DynCastExtHelper [−]
pub trait DynCastExtHelper<T> where
T: ?Sized, { type Target; type Source; type Config; pub fn _dyn_cast(self) -> Result<Self::Target, Self::Source>; }
Used to implement DynCastExt
.
Associated Types
type Target
The wanted trait object that is returned if the cast succeeded.
type Source
The original trait object that is returned if the cast failed.
type Config
The DynCastConfig
that is used to preform the conversion.
Required methods
pub fn _dyn_cast(self) -> Result<Self::Target, Self::Source>
This method is used to cast from one trait object type to another.
Implementations on Foreign Types
impl<'a, T, F> DynCastExtHelper<T> for &'a mut F where
T: 'static + ?Sized,
F: 'static + DynCast<<F as GetDynCastConfig<T>>::Config> + GetDynCastConfig<T> + ?Sized,
T: 'static + ?Sized,
F: 'static + DynCast<<F as GetDynCastConfig<T>>::Config> + GetDynCastConfig<T> + ?Sized,
type Target = &'a mut T
type Source = &'a mut F
type Config = <F as GetDynCastConfig<T>>::Config
pub fn _dyn_cast(
self
) -> Result<<&'a mut F as DynCastExtHelper<T>>::Target, <&'a mut F as DynCastExtHelper<T>>::Source>
self
) -> Result<<&'a mut F as DynCastExtHelper<T>>::Target, <&'a mut F as DynCastExtHelper<T>>::Source>
impl<'a, T, F> DynCastExtHelper<T> for Rc<F> where
T: 'static + ?Sized,
F: 'static + DynCast<<F as GetDynCastConfig<T>>::Config> + GetDynCastConfig<T> + ?Sized,
T: 'static + ?Sized,
F: 'static + DynCast<<F as GetDynCastConfig<T>>::Config> + GetDynCastConfig<T> + ?Sized,
type Target = Rc<T>
type Source = Rc<F>
type Config = <F as GetDynCastConfig<T>>::Config
pub fn _dyn_cast(
self
) -> Result<<Rc<F> as DynCastExtHelper<T>>::Target, <Rc<F> as DynCastExtHelper<T>>::Source>
self
) -> Result<<Rc<F> as DynCastExtHelper<T>>::Target, <Rc<F> as DynCastExtHelper<T>>::Source>
impl<'a, T, F> DynCastExtHelper<T> for &'a F where
T: 'static + ?Sized,
F: 'static + DynCast<<F as GetDynCastConfig<T>>::Config> + GetDynCastConfig<T> + ?Sized,
T: 'static + ?Sized,
F: 'static + DynCast<<F as GetDynCastConfig<T>>::Config> + GetDynCastConfig<T> + ?Sized,
type Target = &'a T
type Source = &'a F
type Config = <F as GetDynCastConfig<T>>::Config
pub fn _dyn_cast(
self
) -> Result<<&'a F as DynCastExtHelper<T>>::Target, <&'a F as DynCastExtHelper<T>>::Source>
self
) -> Result<<&'a F as DynCastExtHelper<T>>::Target, <&'a F as DynCastExtHelper<T>>::Source>
impl<'a, T, F> DynCastExtHelper<T> for Box<F, Global> where
T: 'static + ?Sized,
F: 'static + DynCast<<F as GetDynCastConfig<T>>::Config> + GetDynCastConfig<T> + ?Sized,
T: 'static + ?Sized,
F: 'static + DynCast<<F as GetDynCastConfig<T>>::Config> + GetDynCastConfig<T> + ?Sized,
type Target = Box<T, Global>
type Source = Box<F, Global>
type Config = <F as GetDynCastConfig<T>>::Config
pub fn _dyn_cast(
self
) -> Result<<Box<F, Global> as DynCastExtHelper<T>>::Target, <Box<F, Global> as DynCastExtHelper<T>>::Source>
self
) -> Result<<Box<F, Global> as DynCastExtHelper<T>>::Target, <Box<F, Global> as DynCastExtHelper<T>>::Source>
Implementors
impl<'a, T, F> DynCastExtHelper<T> for Arc<F> where
T: 'static + ?Sized,
F: 'static + DynCast<<F as GetDynCastConfig<T>>::Config> + GetDynCastConfig<T> + ?Sized,
T: 'static + ?Sized,
F: 'static + DynCast<<F as GetDynCastConfig<T>>::Config> + GetDynCastConfig<T> + ?Sized,
type Target = Arc<T>
type Source = Arc<F>
type Config = <F as GetDynCastConfig<T>>::Config
pub fn _dyn_cast(
self
) -> Result<<Arc<F> as DynCastExtHelper<T>>::Target, <Arc<F> as DynCastExtHelper<T>>::Source>
self
) -> Result<<Arc<F> as DynCastExtHelper<T>>::Target, <Arc<F> as DynCastExtHelper<T>>::Source>