Skip to main content

ActorStore

Trait ActorStore 

Source
pub trait ActorStore: Send + Sync {
    // Required methods
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, ActorError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_prefix<'life0, 'life1, 'async_trait>(
        &'life0 self,
        prefix: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Vec<u8>)>, ActorError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn alarm<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<OffsetDateTime>, ActorError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn commit<'life0, 'async_trait>(
        &'life0 self,
        writes: ActorWrites,
    ) -> Pin<Box<dyn Future<Output = Result<(), ActorError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The backing store for one actor instance. An adapter implements this per instance; core owns the atomicity, so an implementation need only make commit apply its whole set or none of it.

Required Methods§

Source

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

The value at key, or None if there is none.

Source

fn list_prefix<'life0, 'life1, 'async_trait>( &'life0 self, prefix: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Vec<u8>)>, ActorError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Every (key, value) whose key starts with prefix, sorted by key.

Source

fn alarm<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<OffsetDateTime>, ActorError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The pending alarm, or None.

Source

fn commit<'life0, 'async_trait>( &'life0 self, writes: ActorWrites, ) -> Pin<Box<dyn Future<Output = Result<(), ActorError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Applies every write in writes, or none.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§