pub trait TaskRegistry: Send + Sync {
Show 14 methods
// Required methods
fn create<'life0, 'async_trait>(
&'life0 self,
task: Task,
) -> Pin<Box<dyn Future<Output = Result<Task, PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Option<Task>, PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
task: &'life1 Task,
) -> Pin<Box<dyn Future<Output = Result<Task, PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<bool, PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn restore<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<bool, PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
status: TaskStatus,
result: Option<Value>,
error: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<Task, PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
filter: &'life1 TaskFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_subtasks<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_tree<'life0, 'life1, 'async_trait>(
&'life0 self,
root_id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn add_dependency<'life0, 'async_trait>(
&'life0 self,
dep: TaskDependency,
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn remove_dependency<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task_id: &'life1 TaskId,
depends_on_id: &'life2 TaskId,
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_dependencies<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Vec<TaskDependency>, PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_dependents<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Vec<TaskDependency>, PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_ready_tasks<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Async task storage with CRUD, queries, and dependency management.
All operations are async and return Result<T, PeError>.
Implementations must be Send + Sync for use across async tasks.
Required Methods§
Sourcefn create<'life0, 'async_trait>(
&'life0 self,
task: Task,
) -> Pin<Box<dyn Future<Output = Result<Task, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create<'life0, 'async_trait>(
&'life0 self,
task: Task,
) -> Pin<Box<dyn Future<Output = Result<Task, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new task. Returns the created task with generated ID.
Sourcefn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Option<Task>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Option<Task>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a task by ID. Returns None if not found or deleted.
Sourcefn update<'life0, 'life1, 'async_trait>(
&'life0 self,
task: &'life1 Task,
) -> Pin<Box<dyn Future<Output = Result<Task, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
task: &'life1 Task,
) -> Pin<Box<dyn Future<Output = Result<Task, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update an existing task. Returns the updated task.
Sourcefn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<bool, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<bool, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Soft-delete a task (sets deleted_at). Returns true if found.
Sourcefn restore<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<bool, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn restore<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<bool, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Restore a soft-deleted task. Returns true if found in trash.
Sourcefn update_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
status: TaskStatus,
result: Option<Value>,
error: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<Task, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
status: TaskStatus,
result: Option<Value>,
error: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<Task, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update task status (with lifecycle validation).
Sourcefn list<'life0, 'life1, 'async_trait>(
&'life0 self,
filter: &'life1 TaskFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
filter: &'life1 TaskFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List tasks matching a filter.
Sourcefn get_subtasks<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_subtasks<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get direct subtasks of a parent.
Sourcefn get_tree<'life0, 'life1, 'async_trait>(
&'life0 self,
root_id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_tree<'life0, 'life1, 'async_trait>(
&'life0 self,
root_id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the full subtask tree (recursive) rooted at a task.
Sourcefn add_dependency<'life0, 'async_trait>(
&'life0 self,
dep: TaskDependency,
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_dependency<'life0, 'async_trait>(
&'life0 self,
dep: TaskDependency,
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Add a dependency edge. Rejects if it would create a cycle.
Sourcefn remove_dependency<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task_id: &'life1 TaskId,
depends_on_id: &'life2 TaskId,
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn remove_dependency<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task_id: &'life1 TaskId,
depends_on_id: &'life2 TaskId,
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Remove a dependency edge.
Sourcefn get_dependencies<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Vec<TaskDependency>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_dependencies<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Vec<TaskDependency>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get all dependencies of a task (what it depends on).
Sourcefn get_dependents<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Vec<TaskDependency>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_dependents<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Vec<TaskDependency>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get all dependents of a task (what depends on it).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".