pub struct PacketPeek {
pub packet_type: PacketType,
pub id: u8,
}Expand description
Identity of a framed packet, read without parsing its body.
Correlating a response to a request only needs the first two header bytes.
Going through RawPacket::try_from for that would copy the whole transfer
and allocate a Vec per logical packet, which is wasteful in a polling
loop that runs hundreds of times per second.
Fields§
§packet_type: PacketType§id: u8Implementations§
Source§impl PacketPeek
impl PacketPeek
Trait Implementations§
Source§impl Clone for PacketPeek
impl Clone for PacketPeek
impl Copy for PacketPeek
Source§impl Debug for PacketPeek
impl Debug for PacketPeek
impl Eq for PacketPeek
Source§impl PartialEq for PacketPeek
impl PartialEq for PacketPeek
impl StructuralPartialEq for PacketPeek
Auto Trait Implementations§
impl Freeze for PacketPeek
impl RefUnwindSafe for PacketPeek
impl Send for PacketPeek
impl Sync for PacketPeek
impl Unpin for PacketPeek
impl UnsafeUnpin for PacketPeek
impl UnwindSafe for PacketPeek
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