Skip to main content

TypedDispatcherTrait

Trait TypedDispatcherTrait 

Source
pub trait TypedDispatcherTrait {
    // Required methods
    fn variant_kinds() -> Vec<&'static str>;
    fn variant_fields() -> Vec<(&'static str, Vec<&'static str>)>;

    // Provided method
    fn variant_count() -> usize { ... }
}
Expand description

Reflection over a typed variant universe — typically a Rust enum declaring #[serde(tag = "kind", rename_all = "kebab-case")].

Required Methods§

Source

fn variant_kinds() -> Vec<&'static str>

Kebab-case serde tags of every variant in declaration order. Used by substrate emitters (Nix helpers skeleton, Lisp catalog, coverage tests) to enumerate the variant universe.

Source

fn variant_fields() -> Vec<(&'static str, Vec<&'static str>)>

Field names per variant, paired with the variant’s kebab-case tag. Used by substrate emitters to produce the matching inherit (variant) <fields> Nix patterns.

Provided Methods§

Source

fn variant_count() -> usize

Total variant count. Convenience for coverage assertions.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§