pub struct ProgressBuilder { /* private fields */ }
Expand description

A builder to create Progress with custom configuration.

See custom configuration for an example.

Implementations

Creates Progress using configuration of this ProgressBuilder.

See custom configuration for an example.

Creates ProgressBuilder to configure Progress.

If items is empty then default items are used instead.

progress_builder! macro should be used instead of this, which is same as ProgressBuilder::new(items!(ITEMS)).

Sets increment mode to PreInc.

Increment mode can be PostInc (default) or PreInc.

  • PostInc means that progress position is incremented after the associated work.
    • For example incrementing position from 2 to 3 means that work of step 3 has been completed and work of step 4 is about to begin.
  • PreInc means that progress position is incremented before the associated work.
    • For example incrementing position from 2 to 3 means that work of step 2 has been completed and work of step 3 is about to begin.
Examples

Here first step has been completed and second is about to begin so completion percentage is 33%.

use ml_progress::progress_builder;

let progress = progress_builder!("[" percent "] " pos "/" total)
    .total(Some(3))
    .pre_inc()
    .build()?;
progress.inc(1);
progress.inc(1);
progress.finish_at_current_pos();
[ 33%] 2/3

Sets thousands separator, default is space.

See custom configuration for an example.

Sets progress total, default is None.

See custom configuration for an example.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.