Skip to main content

Module parameters

Module parameters 

Source

Structs§

ArrayParameterizedFamily
BTreeMapParameterizedFamily
HashMapParameterizedFamily
ParameterParameterizedFamily
ParameterPath
Path to a Parameter nested inside a Parameterized type instance, composed of ParameterPathSegments.
PathPrefixedParameterIterator
Iterator adapter that prefixes each yielded ParameterPath with Self::segment. This exists as a dedicated type (instead of using only standard Iterator combinators) because many Parameterized associated iterator types must be named concrete types. A closure-based map(move |...| ...) adapter would capture the prefix segment and produce an unnameable closure type, which is not usable directly in those associated type definitions on stable Rust. PathPrefixedParameterIterator preserves static dispatch and avoids heap allocation and dynamic dispatch.
PhantomDataParameterizedFamily
Placeholder
Placeholder Parameter type for Parameterized types that is used represent Parameterized::parameter_structure. That is, it is used to replace every nested parameter in a Parameterized type yielding a structure-only representation that can later be used with Parameterized::from_parameters to instantiate a Parameterized value with the same shape but different types of parameters.
VecParameterizedFamily

Enums§

ParameterPathSegment
Segment in a ParameterPath. Parameterized::named_parameters, Parameterized::named_parameters_mut, and Parameterized::into_named_parameters produce paths that are made out of ParameterPathSegments.

Traits§

Parameter
Marker trait for leaf parameter values in a Parameterized type. This trait is intentionally empty. A type implementing Parameter is treated as an indivisible leaf by Parameterized traversals. The reason we need this trait in the first place is so that we can distinguish between leaf and container behavior in blanket implementations. For example, Vec<V> implements Parameterized<P> when V: Parameterized<P>. Therefore, Vec<P> is treated as a collection of leaf parameters because P: Parameter implies P: Parameterized<P>, and not as a single leaf. Without this marker, expressing both leaf and container semantics would require overlapping blanket implementations or a stable specialization feature.
Parameterized
Recursively traversable data structure that contains arbitrarily nested Parameter values of type P.
ParameterizedFamily
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.
SameAs
Helper trait used to encode type equality constraints in the associated type bounds of Parameterized. A type X implements SameAs<Y> only when X and Y are the exact same type.