Skip to main content

PoolStore

Trait PoolStore 

Source
pub trait PoolStore: Send + Sync {
    // Required methods
    fn put_task<'life0, 'async_trait>(
        &'life0 self,
        record: TaskRecord,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_task<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 TaskId,
    ) -> Pin<Box<dyn Future<Output = Result<Option<TaskRecord>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_tasks<'life0, 'life1, 'async_trait>(
        &'life0 self,
        filter: &'life1 TaskFilter,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TaskRecord>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_task<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 TaskId,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn put_slot<'life0, 'async_trait>(
        &'life0 self,
        record: SlotRecord,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_slot<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 SlotId,
    ) -> Pin<Box<dyn Future<Output = Result<Option<SlotRecord>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_slots<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SlotRecord>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_slot<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 SlotId,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for storing and retrieving pool state.

Implementations must be Send + Sync for use in async contexts.

Required Methods§

Source

fn put_task<'life0, 'async_trait>( &'life0 self, record: TaskRecord, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Insert or update a task record.

Source

fn get_task<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 TaskId, ) -> Pin<Box<dyn Future<Output = Result<Option<TaskRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a task by ID.

Source

fn list_tasks<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 TaskFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<TaskRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List tasks matching an optional filter.

Source

fn delete_task<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 TaskId, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete a task record.

Source

fn put_slot<'life0, 'async_trait>( &'life0 self, record: SlotRecord, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Insert or update a slot record.

Source

fn get_slot<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 SlotId, ) -> Pin<Box<dyn Future<Output = Result<Option<SlotRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a slot by ID.

Source

fn list_slots<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<SlotRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all slots.

Source

fn delete_slot<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 SlotId, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete a slot record.

Implementors§