Skip to main content

TaskStore

Trait TaskStore 

Source
pub trait TaskStore: Send + Sync {
    // Provided methods
    fn create_task<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _task: &'life1 Task,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_task<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Task>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn update_task<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _task: &'life1 Task,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_tasks_for_goal<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _goal_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn count_completed_tasks_for_goal<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _goal_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn claim_task<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _task_id: &'life1 str,
        _agent_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn log_task_activity<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _activity: &'life1 TaskActivity,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_task_activities<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _task_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TaskActivity>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Task persistence and task activity logs.

Provided Methods§

Source

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

Create a new task within a goal.

Source

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

Get a task by ID.

Source

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

Update a task (full replacement).

Source

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

Get all tasks for a goal.

Source

fn count_completed_tasks_for_goal<'life0, 'life1, 'async_trait>( &'life0 self, _goal_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Count completed/skipped tasks for a goal (used by progress-based circuit breaker).

Source

fn claim_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _task_id: &'life1 str, _agent_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Atomically claim a pending task for an executor.

Source

fn log_task_activity<'life0, 'life1, 'async_trait>( &'life0 self, _activity: &'life1 TaskActivity, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Log an activity entry for a task.

Source

fn get_task_activities<'life0, 'life1, 'async_trait>( &'life0 self, _task_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<TaskActivity>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get activity log for a task.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§