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: ResultType
pub const INPUT_REQUIRED: ResultType
Sourcepub const TASK: ResultType
pub const TASK: ResultType
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§fn default() -> ResultType
fn default() -> ResultType
Source§impl<'de> Deserialize<'de> for ResultType
impl<'de> Deserialize<'de> for ResultType
Source§fn deserialize<D>(
deserializer: D,
) -> Result<ResultType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ResultType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Display for ResultType
impl Display for ResultType
impl Eq for ResultType
Source§impl JsonSchema for ResultType
impl JsonSchema for ResultType
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
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,
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more