1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! `TypedDispatcher` — introspection trait every typed-variant
//! enum implements via `#[derive(TypedDispatcher)]` in gen-macros.
//!
//! Surface the variant universe (kebab-case serde tags + per-variant
//! field names) so the substrate can mechanically:
//!
//! - emit the matching Nix `helpers = { ... }` table skeleton
//! (one entry per variant);
//! - render a Lisp catalog entry naming the dispatcher;
//! - generate a coverage test that fails when a variant has no
//! consumer arm.
//!
//! Trait-only — no runtime dispatch. Rust enums already dispatch
//! natively via `match`; this trait is the *catalog reflection*
//! that exposes the same enum to other runtimes (Nix, Lisp) so they
//! can build dispatch tables against it.
//!
//! ## Naming
//!
//! "Dispatcher" emphasises the catamorphism the trait participates
//! in. See `theory/QUIRK-APPLIER.md` §IV-bis for the full leverage
//! scope — every typed variant universe at a language boundary is a
//! candidate `TypedDispatcher`.
/// Reflection over a typed variant universe — typically a Rust enum
/// declaring `#[serde(tag = "kind", rename_all = "kebab-case")]`.