pub struct Progress {
pub current: i64,
pub total: i64,
}Expand description
A copy-only byte measurement for one tracked transfer.
Uploads report primary-file uploaded bytes. Downloads report the available
prefix of the requested range. Values are not monotonic, and total may be
an estimate. See the module guide.
§Examples
Treat zero totals as indeterminate rather than dividing by zero:
use td_client::Progress;
fn display(progress: Progress) -> String {
match progress.total {
1.. => format!("{} / {} bytes", progress.current, progress.total),
_ => format!("{} bytes", progress.current),
}
}
assert_eq!(display(Progress { current: 64, total: 0 }), "64 bytes");Fields§
§current: i64Uploaded bytes, or downloaded bytes in the requested contiguous prefix.
total: i64Expected transfer size in bytes, or zero when indeterminate.
Trait Implementations§
impl Copy for Progress
impl Eq for Progress
impl StructuralPartialEq for Progress
Auto Trait Implementations§
impl Freeze for Progress
impl RefUnwindSafe for Progress
impl Send for Progress
impl Sync for Progress
impl Unpin for Progress
impl UnsafeUnpin for Progress
impl UnwindSafe for Progress
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