AckTracker

Struct AckTracker 

Source
pub struct AckTracker { /* private fields */ }
Available on crate feature sync only.
Expand description

Acknowledgment tracker

Tracks pending acknowledgments and manages retransmission logic.

Implementations§

Source§

impl AckTracker

Source

pub fn new() -> Self

Create a new ack tracker with default settings

Source

pub fn with_rto( initial_rto: Duration, min_rto: Duration, max_rto: Duration, backoff_multiplier: u32, max_retransmits: u32, ) -> Self

Create with custom RTO settings

Source

pub fn register_sent(&mut self, version: u64)

Register a sent message that needs acknowledgment

Source

pub fn process_ack(&mut self, acked_version: u64) -> Option<Duration>

Process an incoming acknowledgment

Returns the RTT sample if this ack is for a pending message.

Source

pub fn current_rto(&self) -> Duration

Get current RTO based on RTT estimates

Source

pub fn srtt(&self) -> Option<Duration>

Get the smoothed RTT if available

Source

pub fn rttvar(&self) -> Option<Duration>

Get the RTT variance if available

Source

pub fn needs_retransmit(&self) -> impl Iterator<Item = u64> + '_

Get pending acks that need retransmission

Source

pub fn failed_versions(&self) -> impl Iterator<Item = u64> + '_

Get versions that have exceeded max retransmits

Source

pub fn mark_retransmitted(&mut self, version: u64)

Mark a version as retransmitted

Source

pub fn has_pending(&self) -> bool

Check if there are pending acknowledgments

Source

pub fn pending_count(&self) -> usize

Get number of pending acknowledgments

Source

pub fn highest_acked(&self) -> u64

Get highest acknowledged version

Source

pub fn time_until_retransmit(&self) -> Option<Duration>

Get time until next retransmission is needed

Source

pub fn cancel(&mut self, version: u64)

Cancel a pending ack (e.g., on connection close)

Source

pub fn cancel_all(&mut self)

Cancel all pending acks

Source

pub fn reset(&mut self)

Reset tracker state

Trait Implementations§

Source§

impl Debug for AckTracker

Source§

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

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

impl Default for AckTracker

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

Source§

type Output = T

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