pub struct Progress {
pub bytes_sent: u64,
pub chunks_sent: u64,
pub source_bytes: u64,
}Available on (crate features
blocking or tokio or serial) and (crate features blocking or tokio) only.Expand description
Per-chunk progress payload passed to a ProgressCallback. Values are
cumulative across the upload.
Fields§
§bytes_sent: u64Bytes sent so far across all WRITE packets (post-compression).
chunks_sent: u64Number of WRITE packets acknowledged so far.
source_bytes: u64Total bytes read from src (constant across calls within one upload).
Implementations§
Source§impl Progress
impl Progress
Sourcepub fn fraction(&self) -> Option<f32>
pub fn fraction(&self) -> Option<f32>
Fraction of the source uploaded so far, in [0.0, 1.0]. Returns
None when source_bytes is 0 (zero-length upload — undefined
ratio). With compression enabled bytes_sent is the post-compression
wire count, so this ratio can exceed source_bytes only if the
compressor expands the data; the result is clamped to 1.0.
Sourcepub fn percent(&self) -> Option<f32>
pub fn percent(&self) -> Option<f32>
Percent uploaded, in [0.0, 100.0]. Returns None when
source_bytes is 0. See Progress::fraction for the
compression caveat.
Trait Implementations§
impl Copy 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