pub struct ResponseEnvelope {
pub v: u16,
pub request_id: Option<RequestId>,
pub outcome: Outcome,
}Expand description
{ "v", "type": "response", "request_id", "ok", "body" | "error" } (§7.2).
request_id is null when the command’s id could not be read (§5.3).
Fields§
§v: u16Envelope version.
request_id: Option<RequestId>The command’s request_id, or None (null).
outcome: OutcomeSuccess body or error.
Implementations§
Source§impl ResponseEnvelope
impl ResponseEnvelope
Sourcepub fn ok(request_id: RequestId, body: Box<RawValue>) -> Self
pub fn ok(request_id: RequestId, body: Box<RawValue>) -> Self
A success response at PROTOCOL_VERSION.
Sourcepub fn error(request_id: Option<RequestId>, error: ErrorBody) -> Self
pub fn error(request_id: Option<RequestId>, error: ErrorBody) -> Self
An error response at PROTOCOL_VERSION.
Sourcepub fn error_body(&self) -> Option<&ErrorBody>
pub fn error_body(&self) -> Option<&ErrorBody>
The error, if this is a failure.
Sourcepub fn is_recorded(&self) -> bool
pub fn is_recorded(&self) -> bool
Whether this response is stored as the idempotency record (§7.3): every success and
every error except BUSY, RATE_LIMITED, INTERNAL and SLOWMODE_ACTIVE.
Trait Implementations§
Source§impl Clone for ResponseEnvelope
impl Clone for ResponseEnvelope
Source§fn clone(&self) -> ResponseEnvelope
fn clone(&self) -> ResponseEnvelope
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 ResponseEnvelope
impl Debug for ResponseEnvelope
Source§impl<'de> Deserialize<'de> for ResponseEnvelope
impl<'de> Deserialize<'de> for ResponseEnvelope
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ResponseEnvelope
impl RefUnwindSafe for ResponseEnvelope
impl Send for ResponseEnvelope
impl Sync for ResponseEnvelope
impl Unpin for ResponseEnvelope
impl UnsafeUnpin for ResponseEnvelope
impl UnwindSafe for ResponseEnvelope
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