Skip to main content

WorkflowDatabase

Trait WorkflowDatabase 

Source
pub trait WorkflowDatabase:
    WorkflowSql
    + Send
    + Sync {
    // Required method
    fn transaction(
        &self,
        work: &mut dyn FnMut(&dyn WorkflowSql) -> Result<(), String>,
    ) -> Result<(), String>;
}
Expand description

A tenant-owned database with atomic synchronous transactions.

On failure, every write in the callback must roll back. The callback receives the transaction’s SQL view and must not call the parent database recursively.

Required Methods§

Source

fn transaction( &self, work: &mut dyn FnMut(&dyn WorkflowSql) -> Result<(), String>, ) -> Result<(), String>

Runs the callback atomically, rolling back if it returns an error.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§