Macro closed_set
macro_rules! closed_set {
($stored:ident => $view:ident { $($variant:ident),+ $(,)? }) => { ... };
}Expand description
The lifts of a closed family set, dispatched from one variant list, and the
set’s inherent surface over Family.
closed_set!(Stored => View { A, B, … }) generates three items on
Stored:
- the inherent lifts
view,view_with_sliceandview_seeding, each matching every variant and wrapping the member’s own lift under the same name inView— one list, so a family cannot be reachable under the plain lift and missing from the seeded one, and a variant added to the enum but not to the list fails to compile here, once; - the
Liftimpl, forwarding to those; - inherent forwards to every
Familymethod, so a caller reaches the shared walks by method syntax with nothing imported and rustdoc lists them on the set itself.
The set’s own impl Family — the four structural facts per variant — is
written by hand beside the invocation. Every member — leaves included, even
those owning no parameters — provides all three lifts with the signatures
below.