pub trait TriggerHandler<Ctx, Evt>: Send + Sync {
// Required methods
fn events(&self) -> Vec<Evt>;
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn priority(&self) -> i32 { ... }
fn continue_on_error(&self) -> bool { ... }
}nothing calls it; hook triggers run through backbone_core::write_hooks (the generated <Model>WriteHooks and <Model>Triggers)
Expand description
Generic lifecycle trigger handler.
Ctxโ entity-specific trigger context (e.g.TriggerContext<Order>)Evtโ trigger event type (e.g.TriggerEvent)
Required Methodsยง
Sourcefn events(&self) -> Vec<Evt>
๐Deprecated since 3.15.0: nothing calls it; hook triggers run through backbone_core::write_hooks (the generated <Model>WriteHooks and <Model>Triggers)
fn events(&self) -> Vec<Evt>
nothing calls it; hook triggers run through backbone_core::write_hooks (the generated <Model>WriteHooks and <Model>Triggers)
Events this handler responds to.
Sourcefn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
๐Deprecated since 3.15.0: nothing calls it; hook triggers run through backbone_core::write_hooks (the generated <Model>WriteHooks and <Model>Triggers)
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
nothing calls it; hook triggers run through backbone_core::write_hooks (the generated <Model>WriteHooks and <Model>Triggers)
Handle the trigger event.
Provided Methodsยง
Sourcefn priority(&self) -> i32
๐Deprecated since 3.15.0: nothing calls it; hook triggers run through backbone_core::write_hooks (the generated <Model>WriteHooks and <Model>Triggers)
fn priority(&self) -> i32
nothing calls it; hook triggers run through backbone_core::write_hooks (the generated <Model>WriteHooks and <Model>Triggers)
Execution priority โ lower values run first. Default: 0.
Sourcefn continue_on_error(&self) -> bool
๐Deprecated since 3.15.0: nothing calls it; hook triggers run through backbone_core::write_hooks (the generated <Model>WriteHooks and <Model>Triggers)
fn continue_on_error(&self) -> bool
nothing calls it; hook triggers run through backbone_core::write_hooks (the generated <Model>WriteHooks and <Model>Triggers)
Whether to keep dispatching after this handler errors. Default: false.
Dyn Compatibilityยง
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".