pub struct BandwidthMonitor { /* private fields */ }Expand description
Rolling time-window byte counter for measuring incoming or outgoing bandwidth.
Implementations§
Source§impl BandwidthMonitor
impl BandwidthMonitor
Sourcepub fn new(bandwidth_measure_duration: Duration) -> Self
pub fn new(bandwidth_measure_duration: Duration) -> Self
Creates a monitor with the given measurement window duration.
Sourcepub fn record_packet(&mut self, bytes: usize)
pub fn record_packet(&mut self, bytes: usize)
Records bytes bytes in the measurement window.
Trait Implementations§
Source§impl Clone for BandwidthMonitor
impl Clone for BandwidthMonitor
Source§fn clone(&self) -> BandwidthMonitor
fn clone(&self) -> BandwidthMonitor
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 BandwidthMonitor
impl RefUnwindSafe for BandwidthMonitor
impl Send for BandwidthMonitor
impl Sync for BandwidthMonitor
impl Unpin for BandwidthMonitor
impl UnsafeUnpin for BandwidthMonitor
impl UnwindSafe for BandwidthMonitor
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