pub struct LatencyEstimator { /* private fields */ }Expand description
Smoothed endpoint RTT estimates.
The estimator intentionally receives dispatch-to-completion measurements; callers should not feed local queue or pacing delay into it.
Implementations§
Source§impl LatencyEstimator
impl LatencyEstimator
pub fn new(config: LatencyEstimatorConfig) -> Self
pub fn observe(&mut self, sample: Duration)
pub fn observe_at(&mut self, sample: Duration, now: Instant)
pub fn expected_rtt(&self) -> Duration
pub fn short(&self) -> Duration
pub fn long(&self) -> Duration
Sourcepub fn baseline(&self) -> Duration
pub fn baseline(&self) -> Duration
Returns the minimum observed RTT, or the initial estimate before the first successful sample arrives.
pub fn samples(&self) -> u64
Trait Implementations§
Source§impl Clone for LatencyEstimator
impl Clone for LatencyEstimator
Source§fn clone(&self) -> LatencyEstimator
fn clone(&self) -> LatencyEstimator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LatencyEstimator
impl RefUnwindSafe for LatencyEstimator
impl Send for LatencyEstimator
impl Sync for LatencyEstimator
impl Unpin for LatencyEstimator
impl UnsafeUnpin for LatencyEstimator
impl UnwindSafe for LatencyEstimator
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