pub struct PacketHeader {
pub kind: u8,
pub status: u8,
pub length: u16,
pub spid: u16,
pub id: u8,
pub window: u8,
}Expand description
The eight bytes in front of every packet.
Fields§
§kind: u8§status: u8§length: u16Total packet length, header included.
spid: u16§id: u8Increments per packet within a message, wrapping at 255.
window: u8Implementations§
Source§impl PacketHeader
impl PacketHeader
pub fn parse(bytes: &[u8]) -> Result<PacketHeader>
pub fn write_into(&self, out: &mut Vec<u8>)
pub fn is_end_of_message(&self) -> bool
Trait Implementations§
Source§impl Clone for PacketHeader
impl Clone for PacketHeader
Source§fn clone(&self) -> PacketHeader
fn clone(&self) -> PacketHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PacketHeader
Source§impl Debug for PacketHeader
impl Debug for PacketHeader
impl Eq for PacketHeader
Source§impl PartialEq for PacketHeader
impl PartialEq for PacketHeader
impl StructuralPartialEq for PacketHeader
Auto Trait Implementations§
impl Freeze for PacketHeader
impl RefUnwindSafe for PacketHeader
impl Send for PacketHeader
impl Sync for PacketHeader
impl Unpin for PacketHeader
impl UnsafeUnpin for PacketHeader
impl UnwindSafe for PacketHeader
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