Skip to main content

GetDynCastConfig

Trait GetDynCastConfig 

Source
pub trait GetDynCastConfig<T>
where T: ?Sized,
{ type Config: DynCastConfig<Target = T, 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§

Source

type Config: DynCastConfig<Target = T, Source = Self>

A config type that casts from the Self trait to the trait T.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§