pub struct BuiltinRegistry { /* private fields */ }Expand description
Registry mapping builtin handler names to factory closures.
When the CLI assembles DefaultHookEngine, it feeds HookHandlerSpec::Builtin { name } to
Self::lookup_step. Unknown names fail fast at config-load time, so users don’t
discover
typos mid-turn.
The factory signature is Fn() -> Arc<dyn HookHandler>: handlers have no per-config
parameters, and multiple [[hooks.*]] entries referencing the same builtin share a
single
Arc. If a builtin later needs configuration parameters, upgrade name to a
structured
enum and switch the registry to match dispatch.
Implementations§
Source§impl BuiltinRegistry
impl BuiltinRegistry
Sourcepub fn register_step<F>(&mut self, name: &str, factory: F)
pub fn register_step<F>(&mut self, name: &str, factory: F)
Register a builtin step handler factory. Duplicate names overwrite previous entries, allowing tests to stub and replace default behavior.
Sourcepub fn lookup_step(&self, name: &str) -> Option<Arc<dyn StepHandler>>
pub fn lookup_step(&self, name: &str) -> Option<Arc<dyn StepHandler>>
Look up a step handler by name. None means the configuration layer should
fail-fast with an error.