pub trait AsyncStageStore: Send + Sync {
// Required methods
fn put<'life0, 'async_trait>(
&'life0 self,
stage: Stage,
) -> Pin<Box<dyn Future<Output = Result<StageId, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn upsert<'life0, 'async_trait>(
&'life0 self,
stage: Stage,
) -> Pin<Box<dyn Future<Output = Result<StageId, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 StageId,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 StageId,
) -> Pin<Box<dyn Future<Output = Result<Option<Stage>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn contains<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 StageId,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list<'life0, 'async_trait>(
&'life0 self,
lifecycle: Option<StageLifecycle>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Stage>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_lifecycle<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 StageId,
lifecycle: StageLifecycle,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<StoreStats, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Async storage abstraction for stages.
Required Methods§
Sourcefn put<'life0, 'async_trait>(
&'life0 self,
stage: Stage,
) -> Pin<Box<dyn Future<Output = Result<StageId, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
stage: Stage,
) -> Pin<Box<dyn Future<Output = Result<StageId, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert a stage. Returns AlreadyExists if a stage with the same ID is
already present.
Sourcefn upsert<'life0, 'async_trait>(
&'life0 self,
stage: Stage,
) -> Pin<Box<dyn Future<Output = Result<StageId, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert<'life0, 'async_trait>(
&'life0 self,
stage: Stage,
) -> Pin<Box<dyn Future<Output = Result<StageId, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert or replace a stage unconditionally.
Sourcefn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 StageId,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 StageId,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove a stage entirely. Succeeds even if the stage does not exist.
Sourcefn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 StageId,
) -> Pin<Box<dyn Future<Output = Result<Option<Stage>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 StageId,
) -> Pin<Box<dyn Future<Output = Result<Option<Stage>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve a stage by ID, returning None if absent.
Sourcefn contains<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 StageId,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn contains<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 StageId,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return true if a stage with the given ID exists.
Sourcefn list<'life0, 'async_trait>(
&'life0 self,
lifecycle: Option<StageLifecycle>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Stage>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self,
lifecycle: Option<StageLifecycle>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Stage>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all stages, optionally filtered by lifecycle variant.
Sourcefn update_lifecycle<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 StageId,
lifecycle: StageLifecycle,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_lifecycle<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 StageId,
lifecycle: StageLifecycle,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Transition the lifecycle of a stage, enforcing valid transitions.
Sourcefn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<StoreStats, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<StoreStats, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Aggregate statistics across the store.