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
impl AckManager
Sourcepub fn packet_loss_pct(&self) -> f32
pub fn packet_loss_pct(&self) -> f32
Returns the recent packet loss percentage (0.0–100.0) measured by the loss monitor.
Sourcepub fn should_send_empty_ack(&self) -> bool
pub fn should_send_empty_ack(&self) -> bool
Returns true if an empty ack packet should be sent this tick.
Sourcepub fn mark_should_send_empty_ack(&mut self)
pub fn mark_should_send_empty_ack(&mut self)
Sets the flag requesting that an empty ack packet be sent.
Sourcepub fn clear_should_send_empty_ack(&mut self)
pub fn clear_should_send_empty_ack(&mut self)
Clears the empty-ack flag without returning it.
Sourcepub fn take_should_send_empty_ack(&mut self) -> bool
pub fn take_should_send_empty_ack(&mut self) -> bool
Take the should_send_empty_ack flag (returns and clears it)
Sourcepub fn next_sender_packet_index(&self) -> PacketIndex
pub fn next_sender_packet_index(&self) -> PacketIndex
Get the index of the next outgoing packet
Sourcepub fn process_incoming_header(
&mut self,
header: &StandardHeader,
base_packet_notifiables: &mut [&mut dyn PacketNotifiable],
packet_notifiables: &mut [&mut dyn PacketNotifiable],
)
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
Sourcepub fn next_outgoing_packet_header(
&mut self,
packet_type: PacketType,
) -> StandardHeader
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.
Sourcepub fn last_received_packet_index(&self) -> PacketIndex
pub fn last_received_packet_index(&self) -> PacketIndex
Returns the sequence index of the most recently received packet.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AckManager
impl RefUnwindSafe for AckManager
impl Send for AckManager
impl Sync for AckManager
impl Unpin for AckManager
impl UnsafeUnpin for AckManager
impl UnwindSafe for AckManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more