pub struct BandwidthTracker { /* private fields */ }Expand description
Bandwidth tracker for monitoring network usage.
Implementations§
Source§impl BandwidthTracker
impl BandwidthTracker
Sourcepub fn new(limits: BandwidthLimits) -> Self
pub fn new(limits: BandwidthLimits) -> Self
Create a new bandwidth tracker.
Sourcepub fn record_transfer(
&self,
from: WorkerId,
to: WorkerId,
bytes: u64,
) -> Result<()>
pub fn record_transfer( &self, from: WorkerId, to: WorkerId, bytes: u64, ) -> Result<()>
Record data transfer.
Sourcepub fn get_worker_bandwidth(&self, worker: &WorkerId) -> Option<f64>
pub fn get_worker_bandwidth(&self, worker: &WorkerId) -> Option<f64>
Get current bandwidth usage for a worker.
Sourcepub fn get_stats(&self) -> BandwidthStats
pub fn get_stats(&self) -> BandwidthStats
Get bandwidth statistics.
Auto Trait Implementations§
impl Freeze for BandwidthTracker
impl !RefUnwindSafe for BandwidthTracker
impl Send for BandwidthTracker
impl Sync for BandwidthTracker
impl Unpin for BandwidthTracker
impl UnsafeUnpin for BandwidthTracker
impl !UnwindSafe for BandwidthTracker
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