pub struct ResultType(/* private fields */);Expand description
Indicates the type of a result object, allowing the client to determine how to parse the response.
The spec defines this as an open string ("complete" | "input_required" | string),
so unknown values are preserved rather than rejected. Servers implementing this
protocol version MUST include resultType in every result. For backward
compatibility, clients MUST treat an absent field as "complete".
Ordinary results model the field as Option<ResultType>: None means the
field is absent on the wire. Constructors default to Some(COMPLETE), and
the server handler strips the "complete" discriminator before responding
to peers that negotiated a protocol version older than 2026-07-28, so
legacy sessions keep their historical wire shape (see
ServerResult::strip_result_type_for_legacy_peer).
Implementations§
Source§impl ResultType
impl ResultType
pub const COMPLETE: Self
pub const INPUT_REQUIRED: Self
Sourcepub const TASK: Self
pub const TASK: Self
SEP-2663 Tasks extension: the result is a task handle (CreateTaskResult).
pub fn as_str(&self) -> &str
Sourcepub fn is_input_required(&self) -> bool
pub fn is_input_required(&self) -> bool
Returns true if this is "input_required".
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns true if this is "complete".
Trait Implementations§
Source§impl Clone for ResultType
impl Clone for ResultType
Source§fn clone(&self) -> ResultType
fn clone(&self) -> ResultType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResultType
impl Debug for ResultType
Source§impl Default for ResultType
impl Default for ResultType
Source§impl<'de> Deserialize<'de> for ResultType
impl<'de> Deserialize<'de> for ResultType
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>,
Source§impl Display for ResultType
impl Display for ResultType
impl Eq for ResultType
Source§impl JsonSchema for ResultType
Available on crate feature schemars only.
impl JsonSchema for ResultType
schemars only.Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for ResultType
impl PartialEq for ResultType
Source§impl Serialize for ResultType
impl Serialize for ResultType
impl StructuralPartialEq for ResultType
Auto Trait Implementations§
impl Freeze for ResultType
impl RefUnwindSafe for ResultType
impl Send for ResultType
impl Sync for ResultType
impl Unpin for ResultType
impl UnsafeUnpin for ResultType
impl UnwindSafe for ResultType
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.