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 more