pub struct TaskProgress {
pub fraction: Option<f64>,
pub bytes_done: u64,
pub bytes_total: Option<u64>,
pub rate_bytes_per_s: Option<f64>,
pub eta_seconds: Option<f64>,
pub state: ProgressState,
}Fields§
§fraction: Option<f64>bytes_done / bytes_total, clamped to 0.0..=1.0. null when
the total is unknown – an indeterminate bar is honest, a bar
pinned at 100% is not.
bytes_done: u64§bytes_total: Option<u64>§rate_bytes_per_s: Option<f64>§eta_seconds: Option<f64>§state: ProgressStateImplementations§
Source§impl TaskProgress
impl TaskProgress
Sourcepub fn from_report(
report: RateReport,
bytes_done: u64,
bytes_total: Option<u64>,
) -> Self
pub fn from_report( report: RateReport, bytes_done: u64, bytes_total: Option<u64>, ) -> Self
The only sanctioned way to build one.
A warming report yields null rate and null ETA no matter
what the caller believes it knows: the estimator’s whole purpose
is refusing to divide too early, and recomputing around it would
reintroduce the “123 GB/s” flash it exists to prevent.
Sourcepub fn indeterminate() -> Self
pub fn indeterminate() -> Self
A job with nothing measurable in bytes (a model load): no fraction, no rate, no pretence of either.
Trait Implementations§
Source§impl Clone for TaskProgress
impl Clone for TaskProgress
Source§fn clone(&self) -> TaskProgress
fn clone(&self) -> TaskProgress
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TaskProgress
Source§impl Debug for TaskProgress
impl Debug for TaskProgress
Source§impl<'de> Deserialize<'de> for TaskProgress
impl<'de> Deserialize<'de> for TaskProgress
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TaskProgress
impl PartialEq for TaskProgress
Source§impl Serialize for TaskProgress
impl Serialize for TaskProgress
impl StructuralPartialEq for TaskProgress
Auto Trait Implementations§
impl Freeze for TaskProgress
impl RefUnwindSafe for TaskProgress
impl Send for TaskProgress
impl Sync for TaskProgress
impl Unpin for TaskProgress
impl UnsafeUnpin for TaskProgress
impl UnwindSafe for TaskProgress
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