#[repr(u8)]pub enum Reliability {
Unreliable = 0,
UnreliableSeq = 1,
Reliable = 2,
ReliableOrd = 3,
ReliableSeq = 4,
UnreliableAck = 5,
ReliableAck = 6,
ReliableOrdAck = 7,
}
Expand description
The RakNet Reliabilty of a packet.
This is a bit flag encoded within each Frame
that determines how the packet should be handled.
As of writing the following reliability types are supported:
Variants§
Unreliable = 0
Unreliable (with no ack)
UnreliableSeq = 1
Unreliable with a sequence
Reliable = 2
Reliable
ReliableOrd = 3
ReliableSeq = 4
Reliably sequenced AND ordered
UnreliableAck = 5
never used over the wire
ReliableAck = 6
never used over the wire
ReliableOrdAck = 7
never used over the wire
Implementations§
Source§impl Reliability
impl Reliability
Sourcepub fn from_flags(flags: u8) -> Self
pub fn from_flags(flags: u8) -> Self
Creates a new Reliability
from the given flags.
This is used internally to decode the reliability from the given
bit flags.
Sourcepub fn to_flags(&self) -> u8
pub fn to_flags(&self) -> u8
Converts the Reliability
into a bit flag.
This is useful for encoding the reliability into a packet.
Sourcepub fn is_ordered(&self) -> bool
pub fn is_ordered(&self) -> bool
This method checks whether the reliability is ordered, meaning that the packets are either:
Sourcepub fn is_reliable(&self) -> bool
pub fn is_reliable(&self) -> bool
Verifies whether or not the reliabilty is reliable, meaning that the packets are either:
Other reliabilities are not reliable, and will return false
.
Sourcepub fn is_unreliable(&self) -> bool
pub fn is_unreliable(&self) -> bool
Verifies whether or not the reliabilty is unreliable, meaning that the packets are either:
Other reliabilities are not unreliable, and will return false
.
Sourcepub fn is_sequenced(&self) -> bool
pub fn is_sequenced(&self) -> bool
Verifies whether or not the reliabilty is sequenced, meaning that the packets are either:
Other reliabilities are not sequenced, and will return false
.
§What is a sequenced packet?
A sequenced packet is a packet with an index that is incremented after each packet. RakNet uses this internally to discard packets that are sent out of sequence, accepting only the latest packet.
Sourcepub fn is_sequenced_or_ordered(&self) -> bool
pub fn is_sequenced_or_ordered(&self) -> bool
Verifies whether or not the reliabilty is sequenced or ordered. This function
is a combination of Reliability::is_sequenced
and Reliability::is_ordered
,
combined into one signature.
Trait Implementations§
Source§impl Clone for Reliability
impl Clone for Reliability
Source§fn clone(&self) -> Reliability
fn clone(&self) -> Reliability
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more