Skip to main content

StateStore

Trait StateStore 

Source
pub trait StateStore: Send + Sync {
    // Required methods
    fn put<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        namespace: &'life1 str,
        key: &'life2 [u8],
        value: &'life3 [u8],
    ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn get<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        namespace: &'life1 str,
        key: &'life2 [u8],
    ) -> Pin<Box<dyn Future<Output = StreamResult<Option<Vec<u8>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        namespace: &'life1 str,
        key: &'life2 [u8],
    ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete_prefix<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        namespace: &'life1 str,
        key_prefix: &'life2 [u8],
    ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn list_prefix<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        namespace: &'life1 str,
        key_prefix: &'life2 [u8],
    ) -> Pin<Box<dyn Future<Output = StreamResult<Vec<(Vec<u8>, Vec<u8>)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided method
    fn persistent_db_path(&self) -> Option<&Path> { ... }
}

Required Methods§

Source

fn put<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, namespace: &'life1 str, key: &'life2 [u8], value: &'life3 [u8], ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn get<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, namespace: &'life1 str, key: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = StreamResult<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn delete<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, namespace: &'life1 str, key: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn delete_prefix<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, namespace: &'life1 str, key_prefix: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn list_prefix<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, namespace: &'life1 str, key_prefix: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = StreamResult<Vec<(Vec<u8>, Vec<u8>)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Provided Methods§

Source

fn persistent_db_path(&self) -> Option<&Path>

Persistent backends (e.g., SQLite) return the database file path; in-memory stores return None.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§