Skip to main content

PersistentMetadataStore

Trait PersistentMetadataStore 

Source
pub trait PersistentMetadataStore: Send + Sync {
    // Required methods
    fn get_subscription_cursor<'life0, 'life1, 'async_trait>(
        &'life0 self,
        mob_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<u64>, MetadataStoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn set_subscription_cursor<'life0, 'life1, 'async_trait>(
        &'life0 self,
        mob_id: &'life1 str,
        cursor: u64,
    ) -> Pin<Box<dyn Future<Output = Result<(), MetadataStoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Persistent storage for mobkit runtime metadata that must survive a gateway restart — currently the structural-events subscription cursor.

Two impls live in this module: InMemoryMetadataStore (no persistence; used when no SQLite mob storage is configured) and SqliteMetadataStore (writes a small mobkit_metadata table next to the mob’s own SQLite store). The UnifiedRuntime builder picks the impl based on the configured MobBootstrapSpec.

Required Methods§

Source

fn get_subscription_cursor<'life0, 'life1, 'async_trait>( &'life0 self, mob_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>, MetadataStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read the last-projected mob events cursor for mob_id. Returns Ok(None) when no cursor has been written yet (fresh deploy or in-memory deployment that just started).

Source

fn set_subscription_cursor<'life0, 'life1, 'async_trait>( &'life0 self, mob_id: &'life1 str, cursor: u64, ) -> Pin<Box<dyn Future<Output = Result<(), MetadataStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Persist the last-projected mob events cursor for mob_id.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§