#[non_exhaustive]pub enum TaskPayload {
Working,
InputRequired {
input_requests: BTreeMap<String, InputRequest>,
},
Completed {
result: Map<String, Value>,
},
Failed {
error: Map<String, Value>,
},
Cancelled,
}Expand description
Status-specific payload carried alongside the base Task fields in a
DetailedTask.
Mirrors the spec’s WorkingTask / InputRequiredTask / CompletedTask /
FailedTask / CancelledTask union: the variant is discriminated by the
status field on the wire, with the payload fields inlined at the top level.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Working
status: "working" — no additional payload.
InputRequired
status: "input_required" — outstanding server-to-client requests.
Fields
input_requests: BTreeMap<String, InputRequest>Server-to-client requests that need to be fulfilled during task execution. Keys are arbitrary identifiers for matching requests to responses, unique over the lifetime of the task.
Completed
status: "completed" — the final result of the task. The structure
matches the result type of the original request (e.g. CallToolResult).
Failed
status: "failed" — the JSON-RPC error that caused the task to fail.
Cancelled
status: "cancelled" — no additional payload.
Implementations§
Source§impl TaskPayload
impl TaskPayload
Sourcepub fn status(&self) -> TaskStatus
pub fn status(&self) -> TaskStatus
The TaskStatus this payload corresponds to.
Trait Implementations§
Source§impl Clone for TaskPayload
impl Clone for TaskPayload
Source§fn clone(&self) -> TaskPayload
fn clone(&self) -> TaskPayload
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TaskPayload
impl Debug for TaskPayload
Source§impl PartialEq for TaskPayload
impl PartialEq for TaskPayload
impl StructuralPartialEq for TaskPayload
Auto Trait Implementations§
impl !RefUnwindSafe for TaskPayload
impl !UnwindSafe for TaskPayload
impl Freeze for TaskPayload
impl Send for TaskPayload
impl Sync for TaskPayload
impl Unpin for TaskPayload
impl UnsafeUnpin for TaskPayload
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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