GetTaskPayloadResult

Struct GetTaskPayloadResult 

Source
pub struct GetTaskPayloadResult {
    pub meta: Option<Map<String, Value>>,
    pub extra: Option<Map<String, Value>>,
}
Expand description

The response to a tasks/result request. The structure matches the result type of the original request. For example, a tools/call task would return the CallToolResult structure.

JSON schema
{
 "description": "The response to a tasks/result request.\nThe structure matches the result type of the original request.\nFor example, a tools/call task would return the CallToolResult structure.",
 "type": "object",
 "properties": {
   "_meta": {
     "description": "See [General fields: _meta](https://modelcontextprotocol.io/specification/2025-11-25/basic/index#meta) for notes on _meta usage.",
     "type": "object",
     "additionalProperties": {}
   }
 },
 "additionalProperties": {}
}

Fields§

§meta: Option<Map<String, Value>>

See General fields: _meta for notes on _meta usage.

§extra: Option<Map<String, Value>>

Implementations§

Source§

impl GetTaskPayloadResult

Source

pub fn related_task_id(&self) -> Option<&str>

Retrieves the related task ID from the metadata, if it exists.

This function looks for a key corresponding to the RELATED_TASK_META_KEY in the meta field of the struct. If the key exists and contains a string value, it returns it as an Option<&str>. If the key is missing or not a string, it returns None.

§Returns
  • Some(&str) if a related task ID exists.
  • None if no related task ID is found.

Sets the related task ID in the metadata.

This function inserts a taskId key with the provided task_id into the meta field. If the meta field is None, it creates a new serde_json::Map and assigns it to meta. The task_id is converted into a string before being inserted.

§Type Parameters
  • T: The type of the task_id. It must implement Into<String> to allow flexible conversion of various types (e.g., &str, String).
§Arguments
  • task_id: The ID of the related task to set. This can be any type that can be converted into a String.

Trait Implementations§

Source§

impl Clone for GetTaskPayloadResult

Source§

fn clone(&self) -> GetTaskPayloadResult

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GetTaskPayloadResult

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for GetTaskPayloadResult

Source§

fn default() -> GetTaskPayloadResult

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for GetTaskPayloadResult

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<GetTaskPayloadResult, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<GetTaskPayloadResult> for ClientResult

Source§

fn from(value: GetTaskPayloadResult) -> ClientResult

Converts to this type from the input type.
Source§

impl From<GetTaskPayloadResult> for MessageFromClient

Source§

fn from(value: GetTaskPayloadResult) -> MessageFromClient

Converts to this type from the input type.
Source§

impl From<GetTaskPayloadResult> for MessageFromServer

Source§

fn from(value: GetTaskPayloadResult) -> MessageFromServer

Converts to this type from the input type.
Source§

impl From<GetTaskPayloadResult> for Result

Source§

fn from(value: GetTaskPayloadResult) -> Result

Converts to this type from the input type.
Source§

impl From<GetTaskPayloadResult> for ResultFromClient

Source§

fn from(value: GetTaskPayloadResult) -> ResultFromClient

Converts to this type from the input type.
Source§

impl From<GetTaskPayloadResult> for ResultFromServer

Source§

fn from(value: GetTaskPayloadResult) -> ResultFromServer

Converts to this type from the input type.
Source§

impl From<GetTaskPayloadResult> for ServerResult

Source§

fn from(value: GetTaskPayloadResult) -> ServerResult

Converts to this type from the input type.
Source§

impl Serialize for GetTaskPayloadResult

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<ResultFromClient> for GetTaskPayloadResult

Source§

type Error = RpcError

The type returned in the event of a conversion error.
Source§

fn try_from( value: ResultFromClient, ) -> Result<GetTaskPayloadResult, <GetTaskPayloadResult as TryFrom<ResultFromClient>>::Error>

Performs the conversion.
Source§

impl TryFrom<ResultFromServer> for GetTaskPayloadResult

Source§

type Error = RpcError

The type returned in the event of a conversion error.
Source§

fn try_from( value: ResultFromServer, ) -> Result<GetTaskPayloadResult, <GetTaskPayloadResult as TryFrom<ResultFromServer>>::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,