pub struct SlopeEstimator { /* private fields */ }Expand description
Grouping plus filtering: acknowledgements in, a delay trend out.
The two halves are separate types because they are separately testable — the accumulator against hand-built arrival patterns, the filter against numeric sequences — and this joins them without adding behaviour of its own.
Implementations§
Source§impl SlopeEstimator
impl SlopeEstimator
Sourcepub fn with_burst_interval(burst_interval: Duration) -> Self
pub fn with_burst_interval(burst_interval: Duration) -> Self
A slope estimator grouping packets sent within burst_interval of each other.
Sourcepub fn estimate_ms(&self) -> f64
pub fn estimate_ms(&self) -> f64
The current filtered trend, in milliseconds.
Sourcepub fn accumulate(&mut self, report: &PacketReport) -> Option<DelayTrend>
pub fn accumulate(&mut self, report: &PacketReport) -> Option<DelayTrend>
Feed one report; returns a reading when a group closed.
Sourcepub fn flush(&mut self) -> Option<DelayTrend>
pub fn flush(&mut self) -> Option<DelayTrend>
Close the stream, emitting the reading for the group still open.
Trait Implementations§
Source§impl Clone for SlopeEstimator
impl Clone for SlopeEstimator
Source§fn clone(&self) -> SlopeEstimator
fn clone(&self) -> SlopeEstimator
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 moreSource§impl Debug for SlopeEstimator
impl Debug for SlopeEstimator
Source§impl Default for SlopeEstimator
impl Default for SlopeEstimator
Source§fn default() -> SlopeEstimator
fn default() -> SlopeEstimator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SlopeEstimator
impl RefUnwindSafe for SlopeEstimator
impl Send for SlopeEstimator
impl Sync for SlopeEstimator
impl Unpin for SlopeEstimator
impl UnsafeUnpin for SlopeEstimator
impl UnwindSafe for SlopeEstimator
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