pub struct StandardHeader {
pub packet_type: PacketType,
pub sender_packet_index: PacketIndex,
pub sender_ack_index: PacketIndex,
pub sender_ack_bitfield: u32,
}Fields§
§packet_type: PacketType§sender_packet_index: PacketIndexPacket index identifying this packet
sender_ack_index: PacketIndexThis is the last acknowledged sequence number.
sender_ack_bitfield: u32This is an bitfield of all last 32 acknowledged packages
Implementations§
Source§impl StandardHeader
impl StandardHeader
Sourcepub fn new(
packet_type: PacketType,
sender_packet_index: PacketIndex,
sender_ack_index: PacketIndex,
sender_ack_bitfield: u32,
) -> StandardHeader
pub fn new( packet_type: PacketType, sender_packet_index: PacketIndex, sender_ack_index: PacketIndex, sender_ack_bitfield: u32, ) -> StandardHeader
When we compose packet headers, the local sequence becomes the sequence
number of the packet, and the remote sequence becomes the ack.
The ack bitfield is calculated by looking into a queue of up to 33
packets, containing sequence numbers in the range [remote sequence - 32, remote sequence]. We set bit n (in [1,32]) in ack bits to 1 if the
sequence number remote sequence - n is in the received queue.
Trait Implementations§
Source§impl Clone for StandardHeader
impl Clone for StandardHeader
Source§fn clone(&self) -> StandardHeader
fn clone(&self) -> StandardHeader
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 StandardHeader
impl Debug for StandardHeader
Source§impl PartialEq for StandardHeader
impl PartialEq for StandardHeader
Source§impl Serde for StandardHeader
impl Serde for StandardHeader
impl Copy for StandardHeader
impl StructuralPartialEq for StandardHeader
Auto Trait Implementations§
impl Freeze for StandardHeader
impl RefUnwindSafe for StandardHeader
impl Send for StandardHeader
impl Sync for StandardHeader
impl Unpin for StandardHeader
impl UnwindSafe for StandardHeader
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