PacketConfig

Struct PacketConfig 

Source
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

Source

pub fn new() -> Self

Create a new packet configuration with default values.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn set_reliable(&mut self, reliable: bool)

Read reliable doc for explanation of this value.

Source

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.

Source

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.

Source

pub fn clear_cumulative_ack(&mut self)

Clear the cumulative ack from this packet.

Source

pub fn single_acks(&self) -> &VecDeque<u32>

Source

pub fn single_acks_mut(&mut self) -> &mut VecDeque<u32>

Source

pub fn on_channel(&self) -> bool

Source

pub fn indexed_channel(&self) -> Option<(u32, u32)>

Return the indexed channel, if existing, using tuple (id, version).

Source

pub fn set_indexed_channel(&mut self, id: u32, version: u32)

Source

pub fn clear_indexed_channel(&mut self)

Source

pub fn set_on_channel(&mut self, on_channel: bool)

Source

pub fn has_checksum(&self) -> bool

Source

pub fn set_checksum(&mut self, enabled: bool)

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> PacketConfig

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 PacketConfig

Source§

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

Formats the value using the given formatter. Read more

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> Same for T

Source§

type Output = T

Should always be Self
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