Skip to main content

Task

Struct Task 

Source
pub struct Task { /* private fields */ }
Expand description

A single tracked task. Mirrors rich.progress.Task; read-only outside Progress.

Implementations§

Source§

impl Task

Source

pub fn id(&self) -> TaskId

This task’s id.

Source

pub fn description(&self) -> &str

The description (console markup).

Source

pub fn total(&self) -> Option<f64>

The total number of steps, or None when indeterminate.

Source

pub fn completed(&self) -> f64

The number of steps completed.

Source

pub fn visible(&self) -> bool

Whether the task is shown.

Source

pub fn started(&self) -> bool

Whether the task has been started.

Source

pub fn remaining(&self) -> Option<f64>

Steps left, or None when indeterminate.

Source

pub fn elapsed(&self) -> Option<f64>

Seconds since the task started (to its stop time, if stopped).

Source

pub fn finished(&self) -> bool

Whether the task has reached its total.

Source

pub fn finished_time(&self) -> Option<f64>

The elapsed time recorded when the task finished.

Source

pub fn percentage(&self) -> f64

The completion percentage, clamped to 0–100 (0 without a total).

Source

pub fn speed(&self) -> Option<f64>

Steps per second over the sample window, or None without enough samples.

Source

pub fn time_remaining(&self) -> Option<f64>

Estimated seconds remaining (rounded up), 0 once finished.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Task

§

impl !UnwindSafe for Task

§

impl Freeze for Task

§

impl Send for Task

§

impl Sync for Task

§

impl Unpin for Task

§

impl UnsafeUnpin for Task

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.