Expand description
Action registry for name→ID mapping and dispatch Action Registry - Maps action IDs to handlers
Provides hybrid type-safety with String names for UI triggers and numeric IDs for fast execution path.
§Architecture
- UI Layer: Triggers actions by string name (“reset”, “randomize”)
- Registry: Maps names → numeric IDs (HashMap)
- Executor: Dispatches by numeric ID (Vec indexing)
§Standard Actions
Reserved IDs 0-99 for built-in actions:
0: Reset - Return parameters to defaults1: Randomize - Randomize within widget ranges
§Custom Actions
IDs 100+ for plugin-defined actions, executed via WASM.
§Usage
ⓘ
use glitcher_api::registry::ActionRegistry;
use glitcher_api::actions::ActionContext;
let registry = ActionRegistry::from_manifest(manifest);
// UI trigger by name
let updates = registry.trigger("reset", &ctx, 0)?;
// Fast path by ID
let updates = registry.execute(standard_actions::RESET, &ctx, 0)?;Modules§
- standard_
actions - Standard action ID constants (0-99 reserved)
Structs§
- Action
Registry - Action registry for a node
Enums§
- Action
Handler - Action handler variants
- Standard
Action - Standard built-in actions
Type Aliases§
- Action
Id - Numeric action ID for fast dispatch