Skip to main content

HistoryProvider

Trait HistoryProvider 

Source
pub trait HistoryProvider: Send + Sync {
    // Required method
    fn history<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        table: &'life1 str,
        id: &'life2 str,
        limit: u32,
        offset: u32,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<HistoryEntry>>, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Supplies a record’s change history to the generic CRUD router.

This exists so backbone-core never learns that an audit module exists. The composing service builds a provider and installs it as an axum Extension; a composition without one simply has no history to serve, and says so rather than pretending.

Required Methods§

Source

fn history<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, table: &'life1 str, id: &'life2 str, limit: u32, offset: u32, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<HistoryEntry>>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

History for one row of table (schema-qualified, e.g. sapiens.users).

Ok(None) means this table is not audited — deliberately distinct from Ok(Some(vec![])), which means it is audited and genuinely never changed. Collapsing the two would answer “nothing ever happened” to a question that was never actually asked, which is the same defect as a filtered count that quietly returns the whole table.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§