pub struct CreateTaskResult {
pub task: TaskObject,
pub meta: Option<Value>,
}Expand description
Result of creating a task (returned when tools/call is task-augmented).
Per SEP-2663, CreateTaskResult = Result & Task: the task fields are
inlined at the top of the result and resultType is set to "task" so
clients can distinguish a task handle from a normal CallToolResult on
the same RPC.
Serialization layout:
{
"resultType": "task",
"taskId": "...",
"status": "working",
"createdAt": "...",
"lastUpdatedAt": "...",
"ttl": null,
"pollInterval": 5000,
// The nested `task` field is emitted purely for back-compat with the
// 2025-11-25 experimental wire format. New clients should read the
// top-level fields and ignore `task`. This nested mirror will be
// removed in a future release.
"task": { "taskId": ..., "status": ..., ... }
}Fields§
§task: TaskObjectThe created task object. Serialized both inline (per SEP-2663) and
under the legacy task key for back-compat.
meta: Option<Value>Optional protocol-level metadata
Implementations§
Source§impl CreateTaskResult
impl CreateTaskResult
Sourcepub const RESULT_TYPE: &'static str = RESULT_TYPE_TASK
pub const RESULT_TYPE: &'static str = RESULT_TYPE_TASK
Wire-spec discriminator value (always "task").
Sourcepub fn new(task: TaskObject) -> CreateTaskResult
pub fn new(task: TaskObject) -> CreateTaskResult
Build a result from a TaskObject, with the SEP-2663 discriminator
pre-populated when serialized.
Trait Implementations§
Source§impl Clone for CreateTaskResult
impl Clone for CreateTaskResult
Source§fn clone(&self) -> CreateTaskResult
fn clone(&self) -> CreateTaskResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CreateTaskResult
impl Debug for CreateTaskResult
Source§impl<'de> Deserialize<'de> for CreateTaskResult
impl<'de> Deserialize<'de> for CreateTaskResult
Source§fn deserialize<D>(
deserializer: D,
) -> Result<CreateTaskResult, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<CreateTaskResult, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for CreateTaskResult
impl Serialize for CreateTaskResult
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
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
Auto Trait Implementations§
impl Freeze for CreateTaskResult
impl RefUnwindSafe for CreateTaskResult
impl Send for CreateTaskResult
impl Sync for CreateTaskResult
impl Unpin for CreateTaskResult
impl UnsafeUnpin for CreateTaskResult
impl UnwindSafe for CreateTaskResult
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