Skip to main content

AckManager

Struct AckManager 

Source
pub struct AckManager { /* private fields */ }
Expand description

Keeps track of sent & received packets, and contains ack information that is copied into the standard header on each outgoing packet

Implementations§

Source§

impl AckManager

Source

pub fn new() -> Self

Creates a new AckManager with default capacities.

Source

pub fn packet_loss_pct(&self) -> f32

Returns the recent packet loss percentage (0.0–100.0) measured by the loss monitor.

Source

pub fn should_send_empty_ack(&self) -> bool

Returns true if an empty ack packet should be sent this tick.

Source

pub fn mark_should_send_empty_ack(&mut self)

Sets the flag requesting that an empty ack packet be sent.

Source

pub fn clear_should_send_empty_ack(&mut self)

Clears the empty-ack flag without returning it.

Source

pub fn take_should_send_empty_ack(&mut self) -> bool

Take the should_send_empty_ack flag (returns and clears it)

Source

pub fn next_sender_packet_index(&self) -> PacketIndex

Get the index of the next outgoing packet

Source

pub fn process_incoming_header( &mut self, header: &StandardHeader, base_packet_notifiables: &mut [&mut dyn PacketNotifiable], packet_notifiables: &mut [&mut dyn PacketNotifiable], )

Process an incoming packet, handle notifications of delivered / dropped packets

Source

pub fn next_outgoing_packet_header( &mut self, packet_type: PacketType, ) -> StandardHeader

Builds and returns the standard header for the next outgoing packet, advancing the sequence counter.

Source

pub fn last_received_packet_index(&self) -> PacketIndex

Returns the sequence index of the most recently received packet.

Trait Implementations§

Source§

impl Default for AckManager

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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, 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