Skip to main content

AsyncStageStore

Trait AsyncStageStore 

Source
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§

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Implementors§