Skip to main content

ConfigChangesStore

Trait ConfigChangesStore 

Source
pub trait ConfigChangesStore:
    Send
    + Sync
    + 'static {
    // Required methods
    fn record<'life0, 'life1, 'async_trait>(
        &'life0 self,
        row: &'life1 ConfigChangeRow,
    ) -> Pin<Box<dyn Future<Output = Result<(), ConfigChangesError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn tail<'life0, 'async_trait>(
        &'life0 self,
        n: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ConfigChangeRow>, ConfigChangesError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        patch_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<ConfigChangeRow>, ConfigChangesError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn record<'life0, 'life1, 'async_trait>( &'life0 self, row: &'life1 ConfigChangeRow, ) -> Pin<Box<dyn Future<Output = Result<(), ConfigChangesError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Idempotent on (patch_id, status) — repeat insert with the same key is a no-op. Caller passes one row per state transition.

Source

fn tail<'life0, 'async_trait>( &'life0 self, n: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<ConfigChangeRow>, ConfigChangesError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Latest n rows ordered by created_at DESC. Capped at 200 internally so a runaway tool call cannot pull the full table into memory.

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, patch_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<ConfigChangeRow>, ConfigChangesError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Latest row for a given patch_id, regardless of status. Returns None when no row exists yet (proposal never recorded — only happens during a race window between staging file write and the first record).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§