pub trait ReplicaStore:
'static
+ Debug
+ Send
+ Sync {
// Required methods
fn state<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
) -> Pin<Box<dyn Future<Output = Result<ReplicaState>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn set_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
state: &'life2 ReplicaState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}
Expand description
Storage for ReplicaState
.
Implementations must propagate context cancellation using [StorageError::Canceled
].
Required Methods§
sourcefn state<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
) -> Pin<Box<dyn Future<Output = Result<ReplicaState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn state<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
) -> Pin<Box<dyn Future<Output = Result<ReplicaState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gets the replica state, if it is contained in the database.
sourcefn set_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
state: &'life2 ReplicaState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn set_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 Ctx,
state: &'life2 ReplicaState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Stores the given replica state into the database.