pub struct ProgressConfig {
pub channel_capacity: usize,
pub eta_min_samples: usize,
pub eta_smoothing_factor: f64,
pub auto_finish_threshold: f64,
pub debounce_interval: Duration,
}Expand description
进度追踪器配置
Fields§
§channel_capacity: usize订阅通道容量(默认 64)
eta_min_samples: usizeETA 计算的最小样本数(默认 3)
eta_smoothing_factor: f64ETA 平滑因子(0.0-1.0,默认 0.3) 值越大,对最新速率的权重越高
auto_finish_threshold: f64自动完成阈值(当进度达到此比例时自动标记完成,默认 1.0)
debounce_interval: Duration进度更新去抖动间隔(默认 50ms) 在此间隔内的多次更新会合并为一次通知
Implementations§
Source§impl ProgressConfig
impl ProgressConfig
Sourcepub fn channel_capacity(self, capacity: usize) -> Self
pub fn channel_capacity(self, capacity: usize) -> Self
设置通道容量
Sourcepub fn debounce_interval(self, interval: Duration) -> Self
pub fn debounce_interval(self, interval: Duration) -> Self
设置去抖动间隔
Sourcepub fn no_debounce(self) -> Self
pub fn no_debounce(self) -> Self
禁用去抖动(每次更新都通知)
Trait Implementations§
Source§impl Clone for ProgressConfig
impl Clone for ProgressConfig
Source§fn clone(&self) -> ProgressConfig
fn clone(&self) -> ProgressConfig
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 moreSource§impl Debug for ProgressConfig
impl Debug for ProgressConfig
Auto Trait Implementations§
impl Freeze for ProgressConfig
impl RefUnwindSafe for ProgressConfig
impl Send for ProgressConfig
impl Sync for ProgressConfig
impl Unpin for ProgressConfig
impl UnwindSafe for ProgressConfig
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