Skip to main content

Progress

Struct Progress 

Source
pub struct Progress {
    pub total: usize,
    /* private fields */
}

Fields§

§total: usize

Implementations§

Source§

impl Progress

Source

pub fn new(total: usize, interval: ProgressInterval) -> Progress

Source

pub fn set_prefix(&mut self, msg: String)

Source

pub fn set_autoprint(&mut self, enabled: bool)

true causes Progress to print to stdout, false causes it to not print.

Source

pub fn set_same_line(&mut self, same_line: bool)

Print updates on the same line in the terminal, as a typical progress bar would. In some CI environments (like AWS CodeBuild) this should be disabled in order for progress updates to appear.

Source

pub fn set(&mut self, new_current: usize) -> bool

Assign a value to the current amount. Returns true if a new line should be printed based on the chosen interval.

Source

pub fn inc(&mut self) -> bool

Increment the current count by 1. Returns true if a new line should be printed based on the chosen interval.

Source

pub fn current_count(&self) -> usize

Get the current count.

Source

pub fn msg(&self) -> String

Get the current progress message.

Source

pub fn finish_msg(&self) -> String

Auto Trait Implementations§

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.