pub enum ClientEnvelope {
Message(ClientMessage),
Request {
request_id: RequestId,
request: ClientRequest,
},
Response {
response_to: RequestId,
response: ClientResponse,
},
}Variants§
Implementations§
Source§impl ClientEnvelope
impl ClientEnvelope
Sourcepub fn into_envelope(self) -> Result<Envelope, Error>
pub fn into_envelope(self) -> Result<Envelope, Error>
encode one typed client-side envelope into the websocket wire shape
§Errors
Returns serde_json::Error when the typed payload cannot be serialized
into the JSON envelope payload.
Sourcepub fn decode(envelope: Envelope) -> Result<Self, EnvelopeDecodeError>
pub fn decode(envelope: Envelope) -> Result<Self, EnvelopeDecodeError>
decode a raw websocket envelope into the typed native client contract
§Errors
Returns EnvelopeDecodeError::UnknownTag when the tag is unknown for
its route, EnvelopeDecodeError::InvalidPayload when a required payload
is missing or malformed and EnvelopeDecodeError::UnexpectedPayload
when a payload is supplied for stoprecording.
Trait Implementations§
Source§impl Clone for ClientEnvelope
impl Clone for ClientEnvelope
Source§fn clone(&self) -> ClientEnvelope
fn clone(&self) -> ClientEnvelope
Returns a duplicate of the value. Read more
1.0.0 · 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 ClientEnvelope
impl Debug for ClientEnvelope
Source§impl PartialEq for ClientEnvelope
impl PartialEq for ClientEnvelope
impl Eq for ClientEnvelope
impl StructuralPartialEq for ClientEnvelope
Auto Trait Implementations§
impl Freeze for ClientEnvelope
impl RefUnwindSafe for ClientEnvelope
impl Send for ClientEnvelope
impl Sync for ClientEnvelope
impl Unpin for ClientEnvelope
impl UnsafeUnpin for ClientEnvelope
impl UnwindSafe for ClientEnvelope
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