Skip to main content

Module wrapper_registry

Module wrapper_registry 

Source
Expand description

SRD-32a — Op Wrapper Registry.

Single source of truth for the named wrappers that compose around an adapter’s base dispenser: which op-template fields each owns, what triggers them, what constraints they declare, and how they describe their assignment to an op.

The companion module crate::wrapper_resolver consumes the registrations submitted via inventory::submit! to compute the per-op composition order. The wrapper implementations themselves live in crate::wrappers and crate::validation — this module is data, not code.

Structs§

WrapperName
Stable identifier for a wrapper. Used in workload override directives, CLI flags, and registry lookups. Wrapped around a &'static str so the value is always interned at the registration site and lookups are pointer-cheap.
WrapperRegistration
One entry per registered wrapper. Entries are submitted at link time via inventory::submit! and collected at startup into the WrapperRegistry view.
WrapperRegistry
Live view over every registered wrapper. Built once at startup from the inventory collection.

Enums§

WrapperLevel
SRD-92 / ExecUnification — the execution-graph level(s) a wrapper is legal at. Today every wrapper is op-level; the unified scaffold (Step 5) reads this to place a layer at the right level once layering goes cross-level. Kept decoupled from executor’s WIP ShellKind until the unification lands.
WrapperSubject
SRD-82/92 — the execution unit a wrapper’s trigger inspects, generalising the registry across levels. An op wrapper reads the Op variant; a phase wrapper the Phase variant (scenario/session variants join when those levels wire up). Op-level wrappers guard with Self::op; the resolver only offers a wrapper subjects of the level it declares (applies_at), so a well-formed wrapper never sees a foreign subject — the guard is a belt-and-braces None return.

Functions§

closest_match
Find the closest match in a list of candidate names, using Levenshtein edit distance. Returns None when no candidate is within distance 3, since beyond that the suggestion is noise.