pub struct UploadStats {
pub total_bytes: u64,
pub uploaded_bytes: u64,
pub total_layers: usize,
pub uploaded_layers: usize,
pub successful_layers: usize,
pub skipped_layers: usize,
pub failed_layers: usize,
pub start_time: Instant,
pub current_layer_start: Option<Instant>,
}Expand description
Upload statistics for tracking progress and performance
Fields§
§total_bytes: u64§uploaded_bytes: u64§total_layers: usize§uploaded_layers: usize§successful_layers: usize§skipped_layers: usize§failed_layers: usize§start_time: Instant§current_layer_start: Option<Instant>Implementations§
Source§impl UploadStats
impl UploadStats
pub fn new(total_bytes: u64, total_layers: usize) -> Self
Sourcepub fn set_total_layers(&mut self, count: usize)
pub fn set_total_layers(&mut self, count: usize)
Set total number of layers
Sourcepub fn start_layer(&mut self)
pub fn start_layer(&mut self)
Legacy method for compatibility with ProgressReporter
Sourcepub fn begin_layer_upload(&mut self, _digest: &str, _size: u64)
pub fn begin_layer_upload(&mut self, _digest: &str, _size: u64)
Begin tracking a specific layer by digest and size
Sourcepub fn mark_layer_completed(&mut self, _digest: &str)
pub fn mark_layer_completed(&mut self, _digest: &str)
Mark a layer as completed successfully
Sourcepub fn mark_layer_skipped(&mut self, _digest: &str)
pub fn mark_layer_skipped(&mut self, _digest: &str)
Mark a layer as skipped (already exists)
Sourcepub fn mark_layer_failed(&mut self, _digest: &str, _error: String)
pub fn mark_layer_failed(&mut self, _digest: &str, _error: String)
Mark a layer as failed
Sourcepub fn total_duration(&self) -> Option<Duration>
pub fn total_duration(&self) -> Option<Duration>
Get total duration of upload
pub fn finish_layer(&mut self, layer_bytes: u64)
pub fn get_progress_percentage(&self) -> f64
pub fn get_average_speed(&self) -> u64
pub fn get_eta(&self) -> Option<Duration>
Trait Implementations§
Source§impl Clone for UploadStats
impl Clone for UploadStats
Source§fn clone(&self) -> UploadStats
fn clone(&self) -> UploadStats
Returns a duplicate of the value. Read more
1.0.0 · 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 UploadStats
impl RefUnwindSafe for UploadStats
impl Send for UploadStats
impl Sync for UploadStats
impl Unpin for UploadStats
impl UnwindSafe for UploadStats
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