Skip to main content

TaskStore

Trait TaskStore 

Source
pub trait TaskStore: Send + Sync {
    // Required methods
    fn add<'life0, 'life1, 'async_trait>(
        &'life0 self,
        who: &'life1 Requester,
        task: NewTask,
    ) -> Pin<Box<dyn Future<Output = Result<Task, TaskError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list<'life0, 'life1, 'async_trait>(
        &'life0 self,
        who: &'life1 Requester,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, TaskError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        who: &'life1 Requester,
        id: &'life2 str,
        change: TaskChange,
    ) -> Pin<Box<dyn Future<Output = Result<Task, TaskError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        who: &'life1 Requester,
        id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Task, TaskError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn scheduled<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, TaskError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn after_fire<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        change: TaskChange,
    ) -> Pin<Box<dyn Future<Output = Result<Task, TaskError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Creates, lists and changes tasks, always within the requester’s visibility.

Required Methods§

Source

fn add<'life0, 'life1, 'async_trait>( &'life0 self, who: &'life1 Requester, task: NewTask, ) -> Pin<Box<dyn Future<Output = Result<Task, TaskError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Creates a task.

Source

fn list<'life0, 'life1, 'async_trait>( &'life0 self, who: &'life1 Requester, ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, TaskError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Tasks visible to who (theirs and their room’s), every status, in display order: active first, then by next firing or due time, then by creation.

Source

fn update<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, who: &'life1 Requester, id: &'life2 str, change: TaskChange, ) -> Pin<Box<dyn Future<Output = Result<Task, TaskError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Changes a visible task.

Source

fn delete<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, who: &'life1 Requester, id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Task, TaskError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Deletes a visible task.

Source

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

Every open or paused task with a next firing, of every owner (the scheduler).

Source

fn after_fire<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, change: TaskChange, ) -> Pin<Box<dyn Future<Output = Result<Task, TaskError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Changes any task by id after it fired (the scheduler; no visibility check).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§