pub struct RecvPacket {
pub header: FixedHeader,
pub body: Vec<u8>,
}Expand description
A packet received from the client: fixed header plus body bytes.
Use RecvPacket::decode to view it as a Packet.
Fields§
§header: FixedHeader§body: Vec<u8>Implementations§
Source§impl RecvPacket
impl RecvPacket
Sourcepub fn decode(&self) -> Packet<'_>
pub fn decode(&self) -> Packet<'_>
Decodes the packet, panicking on malformed data.
§Panics
Panics if the body cannot be decoded for the header’s packet type.
Sourcepub const fn packet_type(&self) -> PacketType
pub const fn packet_type(&self) -> PacketType
The packet type from the fixed header.
Auto Trait Implementations§
impl Freeze for RecvPacket
impl RefUnwindSafe for RecvPacket
impl Send for RecvPacket
impl Sync for RecvPacket
impl Unpin for RecvPacket
impl UnwindSafe for RecvPacket
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