pub enum ServerEnvelope {
Message(ServerMessage),
Request {
request_id: RequestId,
request: ServerRequest,
},
Response {
response_to: RequestId,
response: ServerResponse,
},
}Variants§
Implementations§
Source§impl ServerEnvelope
impl ServerEnvelope
Sourcepub fn into_envelope(self) -> Result<Envelope, Error>
pub fn into_envelope(self) -> Result<Envelope, Error>
encode one typed server-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 server contract
§Errors
Returns EnvelopeDecodeError::UnknownTag when the tag is unknown for
its route or EnvelopeDecodeError::InvalidPayload when a required
payload is missing or malformed.
Trait Implementations§
Source§impl Clone for ServerEnvelope
impl Clone for ServerEnvelope
Source§fn clone(&self) -> ServerEnvelope
fn clone(&self) -> ServerEnvelope
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 ServerEnvelope
impl Debug for ServerEnvelope
Source§impl PartialEq for ServerEnvelope
impl PartialEq for ServerEnvelope
impl Eq for ServerEnvelope
impl StructuralPartialEq for ServerEnvelope
Auto Trait Implementations§
impl Freeze for ServerEnvelope
impl RefUnwindSafe for ServerEnvelope
impl Send for ServerEnvelope
impl Sync for ServerEnvelope
impl Unpin for ServerEnvelope
impl UnsafeUnpin for ServerEnvelope
impl UnwindSafe for ServerEnvelope
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