pub trait TaskStore:
Send
+ Sync
+ 'static {
// Required methods
fn create<'life0, 'async_trait>(
&'life0 self,
task: Task,
) -> Pin<Box<dyn Future<Output = Result<TaskVersion, A2AError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update<'life0, 'async_trait>(
&'life0 self,
task: Task,
) -> Pin<Box<dyn Future<Output = Result<TaskVersion, A2AError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Task>, A2AError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ListTasksRequest,
) -> Pin<Box<dyn Future<Output = Result<ListTasksResponse, A2AError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Interface for persisting and retrieving tasks.
Required Methods§
Sourcefn create<'life0, 'async_trait>(
&'life0 self,
task: Task,
) -> Pin<Box<dyn Future<Output = Result<TaskVersion, A2AError>> + 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<TaskVersion, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new task. Returns the initial version.
Sourcefn update<'life0, 'async_trait>(
&'life0 self,
task: Task,
) -> Pin<Box<dyn Future<Output = Result<TaskVersion, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update<'life0, 'async_trait>(
&'life0 self,
task: Task,
) -> Pin<Box<dyn Future<Output = Result<TaskVersion, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update an existing task. Returns the new version.
Sourcefn get<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Task>, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Task>, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a task by ID.
Sourcefn list<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ListTasksRequest,
) -> Pin<Box<dyn Future<Output = Result<ListTasksResponse, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ListTasksRequest,
) -> Pin<Box<dyn Future<Output = Result<ListTasksResponse, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List tasks matching the request criteria.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".