pub enum ResponseOutcome {
Result {
result: Value,
},
Error {
error: WireError,
},
Event {
event: Value,
},
End {
end: EndMarker,
},
}Expand description
Successful result or structured error. Flattened into Response
so the wire shape is {"id":N,"result":{...}} or
{"id":N,"error":{...}} rather than a nested outcome key.
Streaming verbs use the additional Event and End variants:
Event { event }— one frame in a streaming response. The server may emit zero or more of these per request.End {}— terminates a streaming response normally. Encoded as{"id":N,"end":{}}so the client can match on the field name.
#[serde(untagged)] collapses each variant to its single field —
the keys (result, error, event, end) are mutually
exclusive, so the discriminator is the field name itself rather
than a separate "kind" tag.
Variants§
Trait Implementations§
Source§impl Clone for ResponseOutcome
impl Clone for ResponseOutcome
Source§fn clone(&self) -> ResponseOutcome
fn clone(&self) -> ResponseOutcome
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 ResponseOutcome
impl Debug for ResponseOutcome
Source§impl<'de> Deserialize<'de> for ResponseOutcome
impl<'de> Deserialize<'de> for ResponseOutcome
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ResponseOutcome
impl RefUnwindSafe for ResponseOutcome
impl Send for ResponseOutcome
impl Sync for ResponseOutcome
impl Unpin for ResponseOutcome
impl UnsafeUnpin for ResponseOutcome
impl UnwindSafe for ResponseOutcome
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