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§
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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,
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".