pub trait Parameter { }Expand description
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.
Note that ryft provides a derive macro for this trait that you can use for custom types which need to
implement Parameter by tagging them with #[derive(Parameter)].