[][src]Trait cast_trait_object::DynCastConfig

pub trait DynCastConfig {
    type Target: ?Sized;
    type Source: ?Sized;
}

Specifies the trait that we are casting from and the trait we are casting to.

The reason we need a "config" type instead of just specifying the source and target traits as type parameters in the DynCast trait is that the compiler would error out it certain situations due to it detecting "cycles". "Hiding" the source and target traits as associated types prevent this from happening and allows using the DynCast trait as a supertrait of the source trait from which we perform a cast.

Associated Types

type Target: ?Sized

The trait we are casting to.

type Source: ?Sized

The trait we are casting from and that we want back if the cast failed.

Loading content...

Implementors

impl<S: ?Sized, T: ?Sized> DynCastConfig for ConcreteDynCastConfig<S, T>[src]

type Target = T

type Source = S

Loading content...