pub trait TriggerLookup {
// Required methods
fn fire_before_create(
&self,
ctx: &TriggerContext,
) -> Result<(), ExecutionError>;
fn fire_after_create(
&self,
ctx: &TriggerContext,
) -> Result<(), ExecutionError>;
fn fire_before_update(
&self,
ctx: &TriggerContext,
) -> Result<(), ExecutionError>;
fn fire_after_update(
&self,
ctx: &TriggerContext,
) -> Result<(), ExecutionError>;
fn fire_before_delete(
&self,
ctx: &TriggerContext,
) -> Result<(), ExecutionError>;
fn fire_after_delete(
&self,
ctx: &TriggerContext,
) -> Result<(), ExecutionError>;
}Expand description
Trait for firing trigger hooks during mutation operations.
Implemented for () (no-op) and for PluginRegistry<dyn Trigger>
when the plugin feature is enabled.
Required Methods§
Sourcefn fire_before_create(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>
fn fire_before_create(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>
Fire all before-create triggers. Returns error to abort the operation.
Sourcefn fire_after_create(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>
fn fire_after_create(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>
Fire all after-create triggers.
Sourcefn fire_before_update(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>
fn fire_before_update(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>
Fire all before-update triggers. Returns error to abort the operation.
Sourcefn fire_after_update(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>
fn fire_after_update(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>
Fire all after-update triggers.
Sourcefn fire_before_delete(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>
fn fire_before_delete(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>
Fire all before-delete triggers. Returns error to abort the operation.
Sourcefn fire_after_delete(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>
fn fire_after_delete(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>
Fire all after-delete triggers.
Implementations on Foreign Types§
Source§impl TriggerLookup for ()
No-op implementation: all triggers succeed with no action.
impl TriggerLookup for ()
No-op implementation: all triggers succeed with no action.
fn fire_before_create( &self, _ctx: &TriggerContext, ) -> Result<(), ExecutionError>
fn fire_after_create(&self, _ctx: &TriggerContext) -> Result<(), ExecutionError>
fn fire_before_update( &self, _ctx: &TriggerContext, ) -> Result<(), ExecutionError>
fn fire_after_update(&self, _ctx: &TriggerContext) -> Result<(), ExecutionError>
fn fire_before_delete( &self, _ctx: &TriggerContext, ) -> Result<(), ExecutionError>
fn fire_after_delete(&self, _ctx: &TriggerContext) -> Result<(), ExecutionError>
Source§impl TriggerLookup for PluginRegistry<dyn Trigger>
Available on crate feature plugin only.
impl TriggerLookup for PluginRegistry<dyn Trigger>
Available on crate feature
plugin only.