pub struct PacketHeader {
pub version_type: u8,
pub extension_type: u8,
pub connection_id: ConnectionID,
pub tv_usec: u32,
pub reply_micro: u32,
pub window_size: u32,
pub seq_nr: PacketNumber,
pub ack_nr: PacketNumber,
}Expand description
A packet’s header.
Fields§
§version_type: u8The protocol version and packet type byte.
extension_type: u8The packet header extension type byte.
connection_id: ConnectionIDThe connection ID for the packet.
tv_usec: u32The current timestamp in microseconds.
reply_micro: u32The difference between the local time and the last received packet’s timestamp at the time the packet was received.
window_size: u32The number of bytes available in the receive window.
seq_nr: PacketNumberThe packet’s sequence number.
ack_nr: PacketNumberThe last sequential acknowledged packet number.
Implementations§
Source§impl PacketHeader
impl PacketHeader
Sourcepub fn set_version(&mut self, v: u8)
pub fn set_version(&mut self, v: u8)
Sets the version of the protocol.
Sourcepub fn packet_type(&self) -> PacketType
pub fn packet_type(&self) -> PacketType
The type of the packet.
Sourcepub fn set_packet_type(&mut self, v: PacketType)
pub fn set_packet_type(&mut self, v: PacketType)
Sets the type of the packet.
Sourcepub fn extension_type(&self) -> PacketExtensionType
pub fn extension_type(&self) -> PacketExtensionType
The type of the packet header extension.
Sourcepub fn set_extension_type(&mut self, v: PacketExtensionType)
pub fn set_extension_type(&mut self, v: PacketExtensionType)
Sets the type of the packet header extension.
Sourcepub fn into_bytes(self) -> [u8; 20]
pub fn into_bytes(self) -> [u8; 20]
Converts the packet header to an array of bytes.
Trait Implementations§
Source§impl PartialEq for PacketHeader
impl PartialEq for PacketHeader
Source§fn eq(&self, other: &PacketHeader) -> bool
fn eq(&self, other: &PacketHeader) -> bool
Tests for
self and other values to be equal, and is used by ==.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