pub struct PacketConfig { /* private fields */ }Expand description
Describe a packet configuration that can be used when synchronizing data or state of a packet.
Implementations§
Source§impl PacketConfig
impl PacketConfig
Sourcepub fn sequence_num(&self) -> u32
pub fn sequence_num(&self) -> u32
Returns the sequence number of this packet. It is actually used only if this packet is marked as reliable and/or if the packet is a fragment.
It is set to 0 by default.
Sourcepub fn set_sequence_num(&mut self, num: u32)
pub fn set_sequence_num(&mut self, num: u32)
Set the sequence number of this packet. Read sequence_num doc for
explanation of the usage of the sequence number.
Sourcepub fn sequence_range(&self) -> Option<(u32, u32)>
pub fn sequence_range(&self) -> Option<(u32, u32)>
Returns the range of sequence number in case this packet is a fragment of a packet chain. Both bounds are included.
Sourcepub fn set_sequence_range(&mut self, first: u32, last: u32)
pub fn set_sequence_range(&mut self, first: u32, last: u32)
Set the range of sequence number if this packet is a fragment of a
packet chain. Both bounds are included and last should be greater
than first, this function panics if this condition is not met.
See also clear_sequence_range if you want to clear the range.
Note that the sequence number is not checked to be in bounds.
Sourcepub fn clear_sequence_range(&mut self)
pub fn clear_sequence_range(&mut self)
Clear the range of sequence number. After calling this, the packet is no longer a fragment in a packet chain.
Sourcepub fn reliable(&self) -> bool
pub fn reliable(&self) -> bool
Returns true if the sender of this packet requires an acknowledgment from the receiver upon successful receipt of this packet.
Sourcepub fn set_reliable(&mut self, reliable: bool)
pub fn set_reliable(&mut self, reliable: bool)
Read reliable doc for explanation of this value.
Sourcepub fn cumulative_ack(&self) -> Option<u32>
pub fn cumulative_ack(&self) -> Option<u32>
This number is sent for acknowledging that all sequence numbers up to (but excluding) this ack have been received.
Sourcepub fn set_cumulative_ack(&mut self, num: u32)
pub fn set_cumulative_ack(&mut self, num: u32)
Set the cumulative ack if this packet. Because this value is an excluded
bound, you should not set this to 0. If you want to reset the cumulative
ack, use clear_cumulative_ack instead.
Sourcepub fn clear_cumulative_ack(&mut self)
pub fn clear_cumulative_ack(&mut self)
Clear the cumulative ack from this packet.
pub fn single_acks(&self) -> &VecDeque<u32>
pub fn single_acks_mut(&mut self) -> &mut VecDeque<u32>
pub fn on_channel(&self) -> bool
Sourcepub fn indexed_channel(&self) -> Option<(u32, u32)>
pub fn indexed_channel(&self) -> Option<(u32, u32)>
Return the indexed channel, if existing, using tuple (id, version).
pub fn set_indexed_channel(&mut self, id: u32, version: u32)
pub fn clear_indexed_channel(&mut self)
pub fn set_on_channel(&mut self, on_channel: bool)
pub fn has_checksum(&self) -> bool
pub fn set_checksum(&mut self, enabled: bool)
Sourcepub fn unk_1000(&self) -> Option<u32>
pub fn unk_1000(&self) -> Option<u32>
The usage of this value and flag 0x1000 is unknown. It will be renamed in the future if its purpose is discovered.
Sourcepub fn set_unk_1000(&mut self, val: u32)
pub fn set_unk_1000(&mut self, val: u32)
The usage of this value and flag 0x1000 is unknown. It will be renamed in the future if its purpose is discovered.
Sourcepub fn clear_unk_1000(&mut self)
pub fn clear_unk_1000(&mut self)
The usage of this value and flag 0x1000 is unknown. It will be renamed in the future if its purpose is discovered.
Trait Implementations§
Source§impl Clone for PacketConfig
impl Clone for PacketConfig
Source§fn clone(&self) -> PacketConfig
fn clone(&self) -> PacketConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more