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
impl AckTracker
Sourcepub fn with_rto(
initial_rto: Duration,
min_rto: Duration,
max_rto: Duration,
backoff_multiplier: u32,
max_retransmits: u32,
) -> Self
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
Sourcepub fn register_sent(&mut self, version: u64)
pub fn register_sent(&mut self, version: u64)
Register a sent message that needs acknowledgment
Sourcepub fn process_ack(&mut self, acked_version: u64) -> Option<Duration>
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.
Sourcepub fn current_rto(&self) -> Duration
pub fn current_rto(&self) -> Duration
Get current RTO based on RTT estimates
Sourcepub fn needs_retransmit(&self) -> impl Iterator<Item = u64> + '_
pub fn needs_retransmit(&self) -> impl Iterator<Item = u64> + '_
Get pending acks that need retransmission
Sourcepub fn failed_versions(&self) -> impl Iterator<Item = u64> + '_
pub fn failed_versions(&self) -> impl Iterator<Item = u64> + '_
Get versions that have exceeded max retransmits
Sourcepub fn mark_retransmitted(&mut self, version: u64)
pub fn mark_retransmitted(&mut self, version: u64)
Mark a version as retransmitted
Sourcepub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Check if there are pending acknowledgments
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Get number of pending acknowledgments
Sourcepub fn highest_acked(&self) -> u64
pub fn highest_acked(&self) -> u64
Get highest acknowledged version
Sourcepub fn time_until_retransmit(&self) -> Option<Duration>
pub fn time_until_retransmit(&self) -> Option<Duration>
Get time until next retransmission is needed
Sourcepub fn cancel_all(&mut self)
pub fn cancel_all(&mut self)
Cancel all pending acks
Trait Implementations§
Source§impl Debug for AckTracker
impl Debug for AckTracker
Auto Trait Implementations§
impl Freeze for AckTracker
impl RefUnwindSafe for AckTracker
impl Send for AckTracker
impl Sync for AckTracker
impl Unpin for AckTracker
impl UnwindSafe for AckTracker
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