Struct s2n_quic_transport::recovery::RttEstimator
source · pub struct RttEstimator { /* private fields */ }
Expand description
re-export core
Implementations§
source§impl RttEstimator
impl RttEstimator
sourcepub fn new(initial_rtt: Duration) -> RttEstimator
pub fn new(initial_rtt: Duration) -> RttEstimator
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) -> RttEstimator
pub fn for_new_path(&self, initial_rtt: Duration) -> RttEstimator
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§fn default() -> RttEstimator
fn default() -> RttEstimator
Creates a new RTT Estimator with default initial values
source§impl Hash for RttEstimator
impl Hash for RttEstimator
source§impl PartialEq for RttEstimator
impl PartialEq for RttEstimator
impl Copy for RttEstimator
impl Eq for RttEstimator
impl StructuralPartialEq for RttEstimator
Auto Trait Implementations§
impl Freeze for RttEstimator
impl RefUnwindSafe for RttEstimator
impl Send for RttEstimator
impl Sync for RttEstimator
impl Unpin for RttEstimator
impl UnwindSafe for RttEstimator
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)