pub struct InMemoryTaskStore { /* private fields */ }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§
Trait Implementations§
Source§impl Default for InMemoryTaskStore
impl Default for InMemoryTaskStore
Source§impl TaskStore for InMemoryTaskStore
impl TaskStore for InMemoryTaskStore
Source§fn save_task_if_version<'life0, 'async_trait>(
&'life0 self,
entry: TaskStoreEntry,
expected: u64,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn save_task_if_version<'life0, 'async_trait>(
&'life0 self,
entry: TaskStoreEntry,
expected: u64,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Writes
entry only if the stored task is still at expected version, as a2a-go’s
task store does, so two writers never overwrite each other unseen. The executor
saves every change this way, with entry.version one past expected. Read moreSource§fn create_task<'life0, 'async_trait>(
&'life0 self,
entry: TaskStoreEntry,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_task<'life0, 'async_trait>(
&'life0 self,
entry: TaskStoreEntry,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: '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
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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
Self: 'async_trait,
'life0: '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
Self: 'async_trait,
'life0: 'async_trait,
Lists tasks matching the given parameters.
Source§fn delete_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes a task by ID. Read more
Source§fn save_task<'life0, 'async_trait>(
&'life0 self,
entry: TaskStoreEntry,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn save_task<'life0, 'async_trait>(
&'life0 self,
entry: TaskStoreEntry,
) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Writes
entry over the stored task with the same ID: its status, history,
artifacts, metadata and push configs together. The executor calls it while it holds
the task’s lock, so a read and write-back is never interleaved with another. Read moreAuto Trait Implementations§
impl !Freeze for InMemoryTaskStore
impl !RefUnwindSafe for InMemoryTaskStore
impl Forget for InMemoryTaskStore
impl Move for InMemoryTaskStore
impl Send for InMemoryTaskStore
impl Sync for InMemoryTaskStore
impl Unpin for InMemoryTaskStore
impl UnsafeUnpin for InMemoryTaskStorewhere
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const Waiter is !null: UnsafeUnpin,
Align8<usize>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(String, TaskStoreEntry)>: UnsafeUnpin,
impl UnwindSafe for InMemoryTaskStorewhere
Mutex<Waitlist>: UnwindSafe,
AtomicUsize: UnwindSafe,
HashMap<String, TaskStoreEntry>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more