Skip to main content

Trigger

Trait Trigger 

Source
pub trait Trigger: Plugin {
    // Required methods
    fn on_before_create(
        &self,
        ctx: &TriggerContext,
    ) -> Result<(), CypherLiteError>;
    fn on_after_create(
        &self,
        ctx: &TriggerContext,
    ) -> Result<(), CypherLiteError>;
    fn on_before_update(
        &self,
        ctx: &TriggerContext,
    ) -> Result<(), CypherLiteError>;
    fn on_after_update(
        &self,
        ctx: &TriggerContext,
    ) -> Result<(), CypherLiteError>;
    fn on_before_delete(
        &self,
        ctx: &TriggerContext,
    ) -> Result<(), CypherLiteError>;
    fn on_after_delete(
        &self,
        ctx: &TriggerContext,
    ) -> Result<(), CypherLiteError>;
}
Expand description

A trigger that fires before/after create, update, and delete operations.

Required Methods§

Source

fn on_before_create(&self, ctx: &TriggerContext) -> Result<(), CypherLiteError>

Called before a new entity is created.

Source

fn on_after_create(&self, ctx: &TriggerContext) -> Result<(), CypherLiteError>

Called after a new entity has been created.

Source

fn on_before_update(&self, ctx: &TriggerContext) -> Result<(), CypherLiteError>

Called before an existing entity is updated.

Source

fn on_after_update(&self, ctx: &TriggerContext) -> Result<(), CypherLiteError>

Called after an existing entity has been updated.

Source

fn on_before_delete(&self, ctx: &TriggerContext) -> Result<(), CypherLiteError>

Called before an entity is deleted.

Source

fn on_after_delete(&self, ctx: &TriggerContext) -> Result<(), CypherLiteError>

Called after an entity has been deleted.

Implementors§