Skip to main content

ModuleFactory

Type Alias ModuleFactory 

Source
pub type ModuleFactory = dyn Fn() -> Result<Vec<Box<dyn WafModule>>, Box<dyn Error + Send + Sync>> + Send + Sync;
Expand description

A factory that (re)builds the injected detection modules. Called ONCE at bind and again on every config reload — so modules injected by an embedder (BOUNDARY §4) SURVIVE a SIGHUP and are re-init’d, instead of being dropped (the pre-0.3 behaviour). It returns a Result as a UNIT: on error the whole reload is aborted and the last-good Reloadable (which still holds the working modules) is kept — the modules are never dropped on a failed rebuild. A boxed closure so an embedder can capture its own (enterprise) config.