pub struct Task {
pub task_id: String,
pub status: String,
pub status_message: Option<String>,
pub ttl_ms: Option<u64>,
pub poll_interval_ms: Option<u64>,
pub result: Option<Value>,
pub error: Option<Value>,
pub input_requests: Option<Value>,
}Expand description
A durable async-task handle (the tasks extension). A supported request (e.g.
tools/call) may return one (resultType: "task") instead of blocking; the
client polls method::TASKS_GET until a terminal status.
Fields§
§task_id: String§status: Stringworking | input_required | completed | failed | cancelled.
status_message: Option<String>§ttl_ms: Option<u64>§poll_interval_ms: Option<u64>§result: Option<Value>On completed: what the original request would have returned.
error: Option<Value>On failed: the JSON-RPC error.
input_requests: Option<Value>On input_required: the server’s outstanding input requests (MRTR).
Implementations§
Source§impl Task
impl Task
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
A terminal status (completed/failed/cancelled) — polling stops.
pub fn needs_input(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Task
impl<'de> Deserialize<'de> for Task
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Task, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Task, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Task
impl Serialize for Task
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 Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnsafeUnpin for Task
impl UnwindSafe for Task
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