pub struct BandwidthMonitor { /* private fields */ }Expand description
Bandwidth monitor
Implementations§
Source§impl BandwidthMonitor
impl BandwidthMonitor
Sourcepub async fn current_bandwidth(&self) -> f64
pub async fn current_bandwidth(&self) -> f64
Get current bandwidth estimate (bytes/sec)
Sourcepub fn average_bandwidth(&self) -> f64
pub fn average_bandwidth(&self) -> f64
Get average bandwidth over entire session
Sourcepub fn total_bytes(&self) -> u64
pub fn total_bytes(&self) -> u64
Get total bytes transferred
Sourcepub async fn estimate_time(&self, bytes: u64) -> Duration
pub async fn estimate_time(&self, bytes: u64) -> Duration
Estimate time to download given bytes
Auto Trait Implementations§
impl !Freeze for BandwidthMonitor
impl !RefUnwindSafe for BandwidthMonitor
impl Send for BandwidthMonitor
impl Sync for BandwidthMonitor
impl Unpin 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