#[non_exhaustive]pub enum ResultType {
Complete,
InputRequired,
Other(String),
}Expand description
The type discriminator carried by a 2026-07-28 result (SEP-2322).
The draft schema requires resultType on every result. For backward
compatibility a client MUST treat an absent field as ResultType::Complete;
use ResultType::from_result_value to read it with that rule applied.
Complete is the Default.
The wire form is an open string. "complete" and "input_required" are
defined by SEP-2322; extensions (for example the Tasks extension’s
"task") may define further values, captured by ResultType::Other.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Complete
The request completed; the result carries the final content.
InputRequired
The server needs more input before it can complete the request; the
result is an InputRequiredResult.
Other(String)
A value not defined by SEP-2322, for example an extension discriminator.
Implementations§
Source§impl ResultType
impl ResultType
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Whether this is the default "complete" discriminator.
Sourcepub fn from_result_value(value: &Value) -> ResultType
pub fn from_result_value(value: &Value) -> ResultType
Read the discriminator from a raw result object, applying the SEP-2322
backward-compatibility rule: a missing (or non-string) resultType
reads as ResultType::Complete.
Sourcepub fn stamp_into(&self, result: &mut Value, protocol_version: &str) -> bool
pub fn stamp_into(&self, result: &mut Value, protocol_version: &str) -> bool
Stamp this discriminator onto a serialized result object, gated on the
negotiated protocol version. Returns true when the field was written.
This is how resultType reaches the result base: the field is required
on 2026-07-28 results but must not appear on 2025-11-25 ones, and serde
cannot see the negotiated version, so the gate lives here rather than in
each result struct. Serialize the result, then stamp the value on its way
out. Nothing is written when
version_carries_result_type is false, when result is not a JSON
object, or when the result already carries a resultType (results that
own their discriminator, such as InputRequiredResult and
CreateTaskResult, keep it on every version).
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>,
impl Eq for ResultType
Source§impl From<String> for ResultType
impl From<String> for ResultType
Source§fn from(s: String) -> ResultType
fn from(s: String) -> ResultType
Source§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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.