pub struct McpTaskStore { /* private fields */ }Expand description
Implementations§
Source§impl McpTaskStore
impl McpTaskStore
Sourcepub async fn get(&self, id: &str) -> Option<McpTask>
pub async fn get(&self, id: &str) -> Option<McpTask>
Retrieve a task by ID, returning None if not found or expired.
Sourcepub async fn cancel(&self, id: &str) -> bool
pub async fn cancel(&self, id: &str) -> bool
Transition a task to Cancelled. Returns false if the task is not
found, expired, or already in a terminal state.
Sourcepub async fn update_state(&self, id: &str, state: McpTaskState) -> bool
pub async fn update_state(&self, id: &str, state: McpTaskState) -> bool
Update the state of a task. Returns false if the task is not found or expired.
Sourcepub async fn complete(&self, id: &str, result: Value) -> bool
pub async fn complete(&self, id: &str, result: Value) -> bool
Set a completed result on a task, transitioning it to Completed.
Sourcepub async fn fail(&self, id: &str, error: impl Into<String>) -> bool
pub async fn fail(&self, id: &str, error: impl Into<String>) -> bool
Fail a task with an error message, transitioning it to Failed.
Sourcepub async fn evict_expired(&self) -> usize
pub async fn evict_expired(&self) -> usize
Evict all expired task entries.
Trait Implementations§
Source§impl Clone for McpTaskStore
impl Clone for McpTaskStore
Source§fn clone(&self) -> McpTaskStore
fn clone(&self) -> McpTaskStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for McpTaskStore
impl !RefUnwindSafe for McpTaskStore
impl Send for McpTaskStore
impl Sync for McpTaskStore
impl Unpin for McpTaskStore
impl UnsafeUnpin for McpTaskStore
impl !UnwindSafe for McpTaskStore
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