pub struct TaskMetadata {
pub ttl: Option<u64>,
}Expand description
Metadata for requesting task augmentation on a request
Include this in request parameters to augment the request with task support:
use turbomcp_protocol::types::tasks::TaskMetadata;
use turbomcp_protocol::types::CallToolRequest;
use serde_json::json;
let request = CallToolRequest {
name: "long_tool".to_string(),
arguments: Some(json!({"data": "value"})),
task: Some(TaskMetadata {
ttl: Some(300_000), // Request 5 minute lifetime
}),
_meta: None,
};§TTL Negotiation
The receiver MAY override the requested TTL. Check the actual ttl value
in the returned Task object.
Fields§
§ttl: Option<u64>Requested time-to-live in milliseconds from creation
- Receiver MAY override this value
- Omit for server default TTL
- Use
null(or omit) for unlimited (if server supports)
Trait Implementations§
Source§impl Clone for TaskMetadata
impl Clone for TaskMetadata
Source§fn clone(&self) -> TaskMetadata
fn clone(&self) -> TaskMetadata
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 moreSource§impl Debug for TaskMetadata
impl Debug for TaskMetadata
Source§impl<'de> Deserialize<'de> for TaskMetadata
impl<'de> Deserialize<'de> for TaskMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TaskMetadata
impl PartialEq for TaskMetadata
Source§impl Serialize for TaskMetadata
impl Serialize for TaskMetadata
impl Eq for TaskMetadata
impl StructuralPartialEq for TaskMetadata
Auto Trait Implementations§
impl Freeze for TaskMetadata
impl RefUnwindSafe for TaskMetadata
impl Send for TaskMetadata
impl Sync for TaskMetadata
impl Unpin for TaskMetadata
impl UnwindSafe for TaskMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.