pub struct PacketEnvelope {
pub message_type: MessageType,
pub encryption: EncryptionKind,
pub body: PacketBody,
}Expand description
Full transport envelope before frame encoding.
Fields§
§message_type: MessageTypeMessage category declared in the frame header.
encryption: EncryptionKindEncryption mode declared in the frame header.
body: PacketBodyJSON body payload.
Implementations§
Source§impl PacketEnvelope
impl PacketEnvelope
Sourcepub fn new(body: PacketBody) -> Self
pub fn new(body: PacketBody) -> Self
Builds a plaintext envelope from a body.
Sourcepub fn with_encryption(body: PacketBody, encryption: EncryptionKind) -> Self
pub fn with_encryption(body: PacketBody, encryption: EncryptionKind) -> Self
Builds an envelope with an explicit encryption mode.
Trait Implementations§
Source§impl Clone for PacketEnvelope
impl Clone for PacketEnvelope
Source§fn clone(&self) -> PacketEnvelope
fn clone(&self) -> PacketEnvelope
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 PacketEnvelope
impl Debug for PacketEnvelope
Source§impl<'de> Deserialize<'de> for PacketEnvelope
impl<'de> Deserialize<'de> for PacketEnvelope
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 PacketEnvelope
impl RefUnwindSafe for PacketEnvelope
impl Send for PacketEnvelope
impl Sync for PacketEnvelope
impl Unpin for PacketEnvelope
impl UnsafeUnpin for PacketEnvelope
impl UnwindSafe for PacketEnvelope
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