pub struct ClientResponseEnvelope {
pub request_id: String,
pub protocol_version: u16,
pub result: Result<ClientResponse, ClientErrorEnvelope>,
}Expand description
Client response envelope.
Fields§
§request_id: StringRequest id copied from the request.
protocol_version: u16Protocol version used by the response.
result: Result<ClientResponse, ClientErrorEnvelope>Operation result.
Implementations§
Source§impl ClientResponseEnvelope
impl ClientResponseEnvelope
Sourcepub fn ok(request_id: impl Into<String>, response: ClientResponse) -> Self
pub fn ok(request_id: impl Into<String>, response: ClientResponse) -> Self
Build a successful response.
Sourcepub fn error(request_id: impl Into<String>, error: ClientErrorEnvelope) -> Self
pub fn error(request_id: impl Into<String>, error: ClientErrorEnvelope) -> Self
Build an error response.
Trait Implementations§
Source§impl Clone for ClientResponseEnvelope
impl Clone for ClientResponseEnvelope
Source§fn clone(&self) -> ClientResponseEnvelope
fn clone(&self) -> ClientResponseEnvelope
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 ClientResponseEnvelope
impl Debug for ClientResponseEnvelope
Source§impl<'de> Deserialize<'de> for ClientResponseEnvelope
impl<'de> Deserialize<'de> for ClientResponseEnvelope
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
impl Eq for ClientResponseEnvelope
Source§impl PartialEq for ClientResponseEnvelope
impl PartialEq for ClientResponseEnvelope
Source§fn eq(&self, other: &ClientResponseEnvelope) -> bool
fn eq(&self, other: &ClientResponseEnvelope) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ClientResponseEnvelope
impl Serialize for ClientResponseEnvelope
impl StructuralPartialEq for ClientResponseEnvelope
Auto Trait Implementations§
impl Freeze for ClientResponseEnvelope
impl RefUnwindSafe for ClientResponseEnvelope
impl Send for ClientResponseEnvelope
impl Sync for ClientResponseEnvelope
impl Unpin for ClientResponseEnvelope
impl UnsafeUnpin for ClientResponseEnvelope
impl UnwindSafe for ClientResponseEnvelope
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