Struct s2n_quic_core::recovery::RttEstimator
source · pub struct RttEstimator { /* private fields */ }Implementations§
source§impl RttEstimator
impl RttEstimator
sourcepub fn new(initial_rtt: Duration) -> Self
pub fn new(initial_rtt: Duration) -> Self
Creates a new RTT Estimator with the given initial_rtt
on_max_ack_delay must be called when the max_ack_delay transport
parameter is received to initialize the max_ack_delay value.
sourcepub fn for_new_path(&self, initial_rtt: Duration) -> Self
pub fn for_new_path(&self, initial_rtt: Duration) -> Self
Creates a new RTT Estimator with the max_ack_delay from the current instance
sourcepub fn latest_rtt(&self) -> Duration
pub fn latest_rtt(&self) -> Duration
Gets the latest round trip time sample
sourcepub fn smoothed_rtt(&self) -> Duration
pub fn smoothed_rtt(&self) -> Duration
Gets the weighted average round trip time
sourcepub fn first_rtt_sample(&self) -> Option<Timestamp>
pub fn first_rtt_sample(&self) -> Option<Timestamp>
Gets the timestamp of the first RTT sample
sourcepub fn max_ack_delay(&self) -> Duration
pub fn max_ack_delay(&self) -> Duration
Gets the max_ack_delay
pub fn pto_period(&self, pto_backoff: u32, space: PacketNumberSpace) -> Duration
sourcepub fn on_max_ack_delay(&mut self, max_ack_delay: MaxAckDelay)
pub fn on_max_ack_delay(&mut self, max_ack_delay: MaxAckDelay)
Sets the max_ack_delay value from the peer MaxAckDelay transport parameter
sourcepub fn update_rtt(
&mut self,
ack_delay: Duration,
rtt_sample: Duration,
timestamp: Timestamp,
is_handshake_confirmed: bool,
space: PacketNumberSpace
)
pub fn update_rtt( &mut self, ack_delay: Duration, rtt_sample: Duration, timestamp: Timestamp, is_handshake_confirmed: bool, space: PacketNumberSpace )
Updates the RTT estimate using the given rtt_sample
sourcepub fn persistent_congestion_threshold(&self) -> Duration
pub fn persistent_congestion_threshold(&self) -> Duration
Calculates the persistent congestion threshold used for determining if persistent congestion is being encountered.
pub fn loss_time_threshold(&self) -> Duration
sourcepub fn on_persistent_congestion(&mut self)
pub fn on_persistent_congestion(&mut self)
Allows min_rtt and smoothed_rtt to be overwritten on the next RTT sample after persistent congestion is established.
Trait Implementations§
source§impl Clone for RttEstimator
impl Clone for RttEstimator
source§fn clone(&self) -> RttEstimator
fn clone(&self) -> RttEstimator
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for RttEstimator
impl Debug for RttEstimator
source§impl Default for RttEstimator
impl Default for RttEstimator
source§impl Hash for RttEstimator
impl Hash for RttEstimator
source§impl PartialEq for RttEstimator
impl PartialEq for RttEstimator
source§fn eq(&self, other: &RttEstimator) -> bool
fn eq(&self, other: &RttEstimator) -> bool
self and other values to be equal, and is used
by ==.