pub struct ProgressTracker { /* private fields */ }Expand description
下载进度监控器
Implementations§
Source§impl ProgressTracker
impl ProgressTracker
pub fn reset(&mut self)
Sourcepub fn has_timed_out(&self) -> bool
pub fn has_timed_out(&self) -> bool
检查是否超时
Sourcepub fn progress_percent(&self) -> Option<f64>
pub fn progress_percent(&self) -> Option<f64>
获取下载进度百分比
Sourcepub fn downloaded(&self) -> u64
pub fn downloaded(&self) -> u64
获取已下载字节数
Sourcepub fn total_expected(&self) -> Option<u64>
pub fn total_expected(&self) -> Option<u64>
获取总期望字节数
Trait Implementations§
Source§impl Clone for ProgressTracker
impl Clone for ProgressTracker
Source§fn clone(&self) -> ProgressTracker
fn clone(&self) -> ProgressTracker
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 ProgressTracker
impl RefUnwindSafe for ProgressTracker
impl Send for ProgressTracker
impl Sync for ProgressTracker
impl Unpin for ProgressTracker
impl UnsafeUnpin for ProgressTracker
impl UnwindSafe for ProgressTracker
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