Expand description
Runtime Dispatcher<V, C, O> — the Rust-side peer of
mk-typed-dispatcher.nix. Same catamorphism, native enum types.
Type parameters:
V: the typed variant universe (a Rust enum implementinggen_types::TypedDispatcher). Used for compile-time coverage reflection.C: the runtime context the helpers mutate / read.O: the override type each helper produces. Folded across the variant list per theMergeStrategy.
Sealing: after Dispatcher::new() + N helper(...) calls, the
consumer calls into_sealed(). The seal asserts that every
kind in V::variant_kinds() has a registered helper — silent
unknown variants become impossible at the type level. Missing
coverage returns a typed DispatcherError.
Anti-pattern this primitive eliminates: hand-rolled match
ladders sprinkled across pleme-io controllers/daemons/migration
runners. Pillar 12 (generation over composition) applied at
the Rust runtime layer.
Structs§
- Dispatcher
- Unsealed dispatcher builder. Register helpers per variant kind,
then call
into_sealed()to prove coverage. - Sealed
Dispatcher - Post-seal dispatcher — coverage proved at construction.
applyfolds helpers over the variant list using the configured merge strategy.
Enums§
- Dispatcher
Error - Build-time / seal-time dispatcher error.