pub struct InMemoryTaskStore { /* private fields */ }Available on crate features
server and a2a-v1 only.Expand description
In-memory task store for development and testing.
Uses a RwLock<HashMap> for concurrent access. Not suitable for
production deployments that require persistence across restarts.
Implementations§
Source§impl InMemoryTaskStore
impl InMemoryTaskStore
Sourcepub fn new() -> InMemoryTaskStore
pub fn new() -> InMemoryTaskStore
Creates a new empty in-memory task store.
Trait Implementations§
Source§impl Default for InMemoryTaskStore
impl Default for InMemoryTaskStore
Source§fn default() -> InMemoryTaskStore
fn default() -> InMemoryTaskStore
Returns the “default value” for a type. Read more
Source§impl TaskStore for InMemoryTaskStore
impl TaskStore for InMemoryTaskStore
Source§fn create_task<'life0, 'async_trait>(
&'life0 self,
entry: TaskStoreEntry,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemoryTaskStore: 'async_trait,
fn create_task<'life0, 'async_trait>(
&'life0 self,
entry: TaskStoreEntry,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemoryTaskStore: 'async_trait,
Persists a new task entry.
Source§fn get_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TaskStoreEntry, A2aError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryTaskStore: 'async_trait,
fn get_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TaskStoreEntry, A2aError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryTaskStore: 'async_trait,
Retrieves a task by ID. Read more
Source§fn update_status<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
status: TaskStatus,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryTaskStore: 'async_trait,
fn update_status<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
status: TaskStatus,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryTaskStore: 'async_trait,
Updates the status of an existing task. Read more
Source§fn add_artifact<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
artifact: Artifact,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryTaskStore: 'async_trait,
fn add_artifact<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
artifact: Artifact,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryTaskStore: 'async_trait,
Appends an artifact to an existing task. Read more
Source§fn add_history_message<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryTaskStore: 'async_trait,
fn add_history_message<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryTaskStore: 'async_trait,
Appends a message to the task’s history. Read more
Source§fn find_task_by_context<'life0, 'life1, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskStoreEntry>, A2aError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryTaskStore: 'async_trait,
fn find_task_by_context<'life0, 'life1, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskStoreEntry>, A2aError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryTaskStore: 'async_trait,
Finds the most recently updated non-terminal task for a given contextId.
Returns None if no non-terminal task exists for the context.
Source§fn list_tasks<'life0, 'async_trait>(
&'life0 self,
params: ListTasksParams,
) -> Pin<Box<dyn Future<Output = Result<Vec<TaskStoreEntry>, A2aError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemoryTaskStore: 'async_trait,
fn list_tasks<'life0, 'async_trait>(
&'life0 self,
params: ListTasksParams,
) -> Pin<Box<dyn Future<Output = Result<Vec<TaskStoreEntry>, A2aError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemoryTaskStore: 'async_trait,
Lists tasks matching the given parameters.
Auto Trait Implementations§
impl !Freeze for InMemoryTaskStore
impl !RefUnwindSafe for InMemoryTaskStore
impl Send for InMemoryTaskStore
impl Sync for InMemoryTaskStore
impl Unpin for InMemoryTaskStore
impl UnsafeUnpin for InMemoryTaskStore
impl UnwindSafe for InMemoryTaskStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more