pub struct ProgressState {
pub total_tasks: usize,
pub completed_tasks: usize,
pub active_tasks: usize,
pub max_concurrent: usize,
pub current_concurrent: usize,
pub total_bytes: u64,
pub processed_bytes: u64,
pub start_time: Instant,
pub active_task_details: HashMap<String, TaskProgress>,
pub concurrency_adjustments: Vec<ConcurrencyAdjustment>,
}
Expand description
进度跟踪状态
Fields§
§total_tasks: usize
§completed_tasks: usize
§active_tasks: usize
§max_concurrent: usize
§current_concurrent: usize
§total_bytes: u64
§processed_bytes: u64
§start_time: Instant
§active_task_details: HashMap<String, TaskProgress>
§concurrency_adjustments: Vec<ConcurrencyAdjustment>
Implementations§
Source§impl ProgressState
impl ProgressState
pub fn new(total_tasks: usize, max_concurrent: usize, total_bytes: u64) -> Self
pub fn add_task(&mut self, task: TaskProgress)
pub fn update_task_progress(&mut self, task_id: &str, processed_bytes: u64)
pub fn complete_task(&mut self, task_id: &str)
pub fn adjust_concurrency(&mut self, new_concurrent: usize, reason: String)
pub fn get_progress_percentage(&self) -> f64
pub fn get_estimated_time_remaining(&self) -> Option<Duration>
pub fn get_current_speed(&self) -> u64
Trait Implementations§
Source§impl Clone for ProgressState
impl Clone for ProgressState
Source§fn clone(&self) -> ProgressState
fn clone(&self) -> ProgressState
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 ProgressState
impl RefUnwindSafe for ProgressState
impl Send for ProgressState
impl Sync for ProgressState
impl Unpin for ProgressState
impl UnwindSafe for ProgressState
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