pub trait GetDynCastConfig<T> where
T: ?Sized, {
type Config: DynCastConfig
where
<Self::Config as DynCastConfig>::Target == T,
<Self::Config as DynCastConfig>::Source == Self;
}
Expand description
Get a DynCastConfig
type for a source trait that casts to a target trait T
.
This is used by the impl_dyn_cast
macro to allow specifying only the traits
that are being cast from and to instead of a concrete config type that implements
the DynCastConfig
trait.
This is also needed for the implementation of the DynCastExt
trait to ensure
that type inference works so that it is ergonomic to use.
Required Associated Types
type Config: DynCastConfig
where
<Self::Config as DynCastConfig>::Target == T,
<Self::Config as DynCastConfig>::Source == Self
type Config: DynCastConfig
where
<Self::Config as DynCastConfig>::Target == T,
<Self::Config as DynCastConfig>::Source == Self
A config type that casts from the Self
trait to the trait T
.