pub struct WebSeedStats {
pub total_bytes: AtomicU64,
pub start_time: Option<Instant>,
pub current_second_bytes: AtomicU64,
pub current_second_start: Option<Instant>,
}Expand description
Speed statistics for web-seed downloads.
Tracks download speed separately from peer downloads.
Fields§
§total_bytes: AtomicU64Total bytes downloaded from web seeds
start_time: Option<Instant>Download start time (for speed calculation)
current_second_bytes: AtomicU64Bytes downloaded in the current second (for real-time speed)
current_second_start: Option<Instant>Timestamp of the current second window
Implementations§
Source§impl WebSeedStats
impl WebSeedStats
Sourcepub fn record_bytes(&self, bytes: u64)
pub fn record_bytes(&self, bytes: u64)
Record bytes downloaded from a web seed.
Sourcepub fn total_bytes_downloaded(&self) -> u64
pub fn total_bytes_downloaded(&self) -> u64
Get total bytes downloaded from web seeds.
Sourcepub fn average_speed(&self) -> u64
pub fn average_speed(&self) -> u64
Get average download speed in bytes/sec.
Sourcepub fn current_speed(&self) -> u64
pub fn current_speed(&self) -> u64
Get current download speed in bytes/sec (real-time).
Trait Implementations§
Source§impl Debug for WebSeedStats
impl Debug for WebSeedStats
Source§impl Default for WebSeedStats
impl Default for WebSeedStats
Source§fn default() -> WebSeedStats
fn default() -> WebSeedStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for WebSeedStats
impl RefUnwindSafe for WebSeedStats
impl Send for WebSeedStats
impl Sync for WebSeedStats
impl Unpin for WebSeedStats
impl UnsafeUnpin for WebSeedStats
impl UnwindSafe for WebSeedStats
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