Skip to main content

closed_set

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:

  1. the inherent lifts view, view_with_slice and view_seeding, each matching every variant and wrapping the member’s own lift under the same name in View — 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;
  2. the Lift impl, forwarding to those;
  3. inherent forwards to every Family method, 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.