pub struct Envelope {
pub type: u16,
pub req_id: u32,
pub flags: u16,
pub payload: Vec<u8>,
}Fields§
§type: u16§req_id: u32§flags: u16§payload: Vec<u8>Implementations§
Source§impl Envelope
impl Envelope
pub fn encode(&self) -> Result<Vec<u8>>
pub fn decode(bytes: &[u8]) -> Result<Self>
pub fn decode_with_limits( bytes: &[u8], max_envelope_bytes: usize, max_payload_bytes: usize, ) -> Result<Self>
Sourcepub fn decode_typed(&self) -> Result<WirePayload>
pub fn decode_typed(&self) -> Result<WirePayload>
Decode the envelope payload into a typed protocol message.
Sourcepub fn from_typed(
req_id: u32,
flags: u16,
payload: &WirePayload,
) -> Result<Self>
pub fn from_typed( req_id: u32, flags: u16, payload: &WirePayload, ) -> Result<Self>
Build an envelope from a typed protocol payload.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Envelope
impl<'de> Deserialize<'de> for Envelope
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 Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
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