pub enum BarStyle {
Main,
Minified,
Steps,
Spinner,
ClearOnFinish,
}Expand description
The look & feel of a GradientProgressBar.
This is the layout, independent of the gradient. Pick a layout here, and
pair it with any Gradient (or none, to keep the classic
two-tone wide_bar).
Variants§
Main
The flagship layout: spinner + message + elapsed + wide bar with
bytes/total + percent + ETA. Best suited to a byte-based workload.
Minified
Compact single-line layout, for tight output or secondary bars.
Steps
For chunk / step based workloads (e.g. multithreaded splitting). Shows
pos/len as chunks.
Spinner
Indeterminate progress (no known total): animates a spinner + message.
ClearOnFinish
Like BarStyle::Main, but cleared from the terminal
once it finishes (pair with crate::GradientProgressBar::finish_and_clear).
Implementations§
Source§impl BarStyle
impl BarStyle
Sourcepub const DEFAULT_GRADIENT_WIDTH: usize = 25
pub const DEFAULT_GRADIENT_WIDTH: usize = 25
Default bar width (in cells) used when rendering a gradient.
Modified to 25 instead of 30 because indicatif was wrapping the lines.
Sourcepub fn to_progress_style(
&self,
gradient: Option<Gradient>,
width: usize,
unit: Option<String>,
) -> ProgressStyle
pub fn to_progress_style( &self, gradient: Option<Gradient>, width: usize, unit: Option<String>, ) -> ProgressStyle
Build the indicatif::ProgressStyle for this layout.
When gradient is Some, the bar is rendered by Gradient
(true-color multi-stop). When None, the classic two-tone
{wide_bar:.cyan/blue} is used. width controls the gradient bar’s
column count.