pub struct Estimator { /* private fields */ }Expand description
Bandwidth estimator as defined in Delivery Rate Estimation and BBR Congestion Control.
Implementations§
Source§impl Estimator
impl Estimator
Sourcepub fn delivered_bytes(&self) -> u64
pub fn delivered_bytes(&self) -> u64
Gets the total amount of data in bytes delivered so far over the lifetime of the path, not including non-congestion-controlled packets such as pure ACK packets.
Sourcepub fn lost_bytes(&self) -> u64
pub fn lost_bytes(&self) -> u64
Gets the total amount of data in bytes lost so far over the lifetime of the path
Sourcepub fn rate_sample(&self) -> RateSample
pub fn rate_sample(&self) -> RateSample
Gets the latest RateSample
Sourcepub fn is_app_limited(&self) -> bool
pub fn is_app_limited(&self) -> bool
Returns true if the path is currently in an application-limited period
Sourcepub fn on_packet_sent(
&mut self,
prior_bytes_in_flight: u32,
sent_bytes: usize,
app_limited: Option<bool>,
now: Timestamp,
) -> PacketInfo
pub fn on_packet_sent( &mut self, prior_bytes_in_flight: u32, sent_bytes: usize, app_limited: Option<bool>, now: Timestamp, ) -> PacketInfo
Called when a packet is transmitted
Sourcepub fn on_ack<Pub: Publisher>(
&mut self,
bytes_acknowledged: usize,
newest_acked_time_sent: Timestamp,
newest_acked_packet_info: PacketInfo,
now: Timestamp,
publisher: &mut Pub,
)
pub fn on_ack<Pub: Publisher>( &mut self, bytes_acknowledged: usize, newest_acked_time_sent: Timestamp, newest_acked_packet_info: PacketInfo, now: Timestamp, publisher: &mut Pub, )
Called for each acknowledgement of one or more packets
Sourcepub fn on_packet_discarded(&mut self, bytes_sent: usize)
pub fn on_packet_discarded(&mut self, bytes_sent: usize)
Called when packets are discarded
Sourcepub fn on_explicit_congestion(&mut self, ce_count: u64)
pub fn on_explicit_congestion(&mut self, ce_count: u64)
Called each time explicit congestion is recorded
Sourcepub fn on_app_limited(&mut self, bytes_in_flight: u32)
pub fn on_app_limited(&mut self, bytes_in_flight: u32)
Mark the path as app limited until the given bytes_in_flight are acknowledged
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Estimator
impl RefUnwindSafe for Estimator
impl Send for Estimator
impl Sync for Estimator
impl Unpin for Estimator
impl UnwindSafe for Estimator
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