Struct naia_shared::StandardHeader
source · [−]pub struct StandardHeader { /* private fields */ }Expand description
This header provides reliability information.
Implementations
pub fn new(
p_type: PacketType,
local_packet_index: u16,
last_remote_packet_index: u16,
bit_field: u32,
host_tick: u16,
last_received_tick: u16
) -> StandardHeader
pub fn new(
p_type: PacketType,
local_packet_index: u16,
last_remote_packet_index: u16,
bit_field: u32,
host_tick: u16,
last_received_tick: u16
) -> 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.
Returns the number of bytes in the header
Returns the packet type indicated by the header
Returns the sequence number from this packet.
Returns last acknowledged sequence number.
Returns the last received tick from the remote Host
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for StandardHeader
impl Send for StandardHeader
impl Sync for StandardHeader
impl Unpin for StandardHeader
impl UnwindSafe for StandardHeader
Blanket Implementations
Mutably borrows from an owned value. Read more