Skip to main content

TriggerLookup

Trait TriggerLookup 

Source
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§

Source

fn fire_before_create(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>

Fire all before-create triggers. Returns error to abort the operation.

Source

fn fire_after_create(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>

Fire all after-create triggers.

Source

fn fire_before_update(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>

Fire all before-update triggers. Returns error to abort the operation.

Source

fn fire_after_update(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>

Fire all after-update triggers.

Source

fn fire_before_delete(&self, ctx: &TriggerContext) -> Result<(), ExecutionError>

Fire all before-delete triggers. Returns error to abort the operation.

Source

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.

Source§

impl TriggerLookup for PluginRegistry<dyn Trigger>

Available on crate feature plugin only.

Implementors§