Skip to main content

AsyncTaskLifecycleExt

Trait AsyncTaskLifecycleExt 

Source
pub trait AsyncTaskLifecycleExt: AsyncTaskLifecycle {
    // Provided methods
    fn get_validated<'life0, 'life1, 'async_trait>(
        &'life0 self,
        params: &'life1 TaskQueryParams,
    ) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn cancel_validated<'life0, 'life1, 'async_trait>(
        &'life0 self,
        params: &'life1 TaskIdParams,
    ) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Validation conveniences over AsyncTaskLifecycle.

Blanket-implemented for every AsyncTaskLifecycle, so implementors get these for free and only ever stub the core primitives. Constructing a TaskId from request parameters performs the empty-string validation, so these wrappers parse the wire parameters once at the boundary.

Provided Methods§

Source

fn get_validated<'life0, 'life1, 'async_trait>( &'life0 self, params: &'life1 TaskQueryParams, ) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate query parameters, then fetch the task.

Source

fn cancel_validated<'life0, 'life1, 'async_trait>( &'life0 self, params: &'life1 TaskIdParams, ) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate ID parameters, then cancel the task.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§