pub trait ParameterizedFamily<P: Parameter>: Sized {
type To: Parameterized<P, Family = Self, ParameterStructure = <Self as ParameterizedFamily<Placeholder>>::To>
where Self: ParameterizedFamily<Placeholder>;
}Expand description
Type-level family that maps Parameter types nested in a type while preserving its overall
structure. This is used internally by Parameterized and is based on the type family approach described in
this blog post.
This trait is generic over P (instead of using a non-generic family trait with type To<P: Parameter>) so
that each family can constrain the parameter domain at the impl level. For example, a family can implement
ParameterizedFamily<P> only for P: Parameter + Clone. With a generic associated type To<P> on a non-generic
family trait, the declaration would quantify over all P: Parameter, and implementations would not be allowed to
add stricter per-family bounds on P.
Required Associated Types§
Sourcetype To: Parameterized<P, Family = Self, ParameterStructure = <Self as ParameterizedFamily<Placeholder>>::To>
where
Self: ParameterizedFamily<Placeholder>
type To: Parameterized<P, Family = Self, ParameterStructure = <Self as ParameterizedFamily<Placeholder>>::To> where Self: ParameterizedFamily<Placeholder>
Type obtained by replacing Parameter types nested in this type with P.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.