Skip to main content

TemplateHook

Type Alias TemplateHook 

Source
pub type TemplateHook = Arc<dyn Fn(&TemplateEvent) + Send + Sync + 'static>;
Expand description

Type alias for template event hooks.

Hooks are functions that receive a reference to a TemplateEvent and can perform any side effects (logging, metrics, etc.).

Hooks must be:

  • Send + Sync for thread safety
  • 'static lifetime to be stored in the parser

Aliased Typeยง

pub struct TemplateHook { /* private fields */ }