Enum Reliability

Source
#[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

Source

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.

Source

pub fn to_flags(&self) -> u8

Converts the Reliability into a bit flag. This is useful for encoding the reliability into a packet.

Source

pub fn is_ordered(&self) -> bool

This method checks whether the reliability is ordered, meaning that the packets are either:

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn is_ack(&self) -> bool

Verifies that the reliability is an ack (Ack). This is primarily used internally to determine whether or not to send an ack.

Trait Implementations§

Source§

impl Clone for Reliability

Source§

fn clone(&self) -> Reliability

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Reliability

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for Reliability

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V