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
impl GetTaskPayloadResult
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.Noneif 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 thetask_id. It must implementInto<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 aString.
Trait Implementations§
Source§impl Clone for GetTaskPayloadResult
impl Clone for GetTaskPayloadResult
Source§fn clone(&self) -> GetTaskPayloadResult
fn clone(&self) -> GetTaskPayloadResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more