pub trait AsyncTaskLifecycle: Send + Sync {
// Required methods
fn create<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
context_id: &'life2 ContextId,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
history_length: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + 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,
state: TaskState,
message: Option<Message>,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn cancel<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<bool, A2AError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Async task lifecycle management: the core CRUD capability over individual tasks.
A handler implements this trait if it can create, read, mutate, and cancel
tasks. Listing/querying across tasks is a separate capability — see
AsyncTaskQuery. Convenience wrappers that validate request parameters
live on AsyncTaskLifecycleExt, which is blanket-implemented for every
AsyncTaskLifecycle.
Required Methods§
Sourcefn create<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
context_id: &'life2 ContextId,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
context_id: &'life2 ContextId,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new task in the given context.
Sourcefn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
history_length: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
history_length: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a task by ID with optional history length limit.
Sourcefn update_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
state: TaskState,
message: Option<Message>,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + 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,
state: TaskState,
message: Option<Message>,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update task status, optionally appending a message to history.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".