pub struct ProgressBar { /* private fields */ }Expand description
A progress bar. Mirrors rich.progress_bar.ProgressBar.
Implementations§
Source§impl ProgressBar
impl ProgressBar
Sourcepub fn new(total: f64, completed: f64) -> Self
pub fn new(total: f64, completed: f64) -> Self
A bar of completed out of total, with upstream’s default bar.* styles.
Sourcepub fn indeterminate() -> Self
pub fn indeterminate() -> Self
A bar with no total, which always pulses (upstream total=None).
Sourcepub fn width(self, width: usize) -> Self
pub fn width(self, width: usize) -> Self
Fix the bar width (otherwise it fills the available width).
Sourcepub fn style(self, style: impl Into<StyleType>) -> Self
pub fn style(self, style: impl Into<StyleType>) -> Self
The background style (upstream style, default bar.back).
Sourcepub fn complete_style(self, style: impl Into<StyleType>) -> Self
pub fn complete_style(self, style: impl Into<StyleType>) -> Self
The completed-part style (upstream complete_style, default bar.complete).
Sourcepub fn finished_style(self, style: impl Into<StyleType>) -> Self
pub fn finished_style(self, style: impl Into<StyleType>) -> Self
The style once finished (upstream finished_style, default bar.finished).
Sourcepub fn pulse_style(self, style: impl Into<StyleType>) -> Self
pub fn pulse_style(self, style: impl Into<StyleType>) -> Self
The pulse style (upstream pulse_style, default bar.pulse).
Sourcepub fn pulse(self, pulse: bool) -> Self
pub fn pulse(self, pulse: bool) -> Self
Render the pulse animation instead of the completion (upstream pulse).
Sourcepub fn animation_time(self, time: f64) -> Self
pub fn animation_time(self, time: f64) -> Self
The time, in seconds, the pulse is drawn at (upstream animation_time).
Without it the pulse follows a monotonic clock.
Trait Implementations§
Source§impl Renderable for ProgressBar
impl Renderable for ProgressBar
Source§fn measure(&self, _console: &Console, options: &ConsoleOptions) -> Measurement
fn measure(&self, _console: &Console, options: &ConsoleOptions) -> Measurement
Port of ProgressBar.__rich_measure__: a fixed width measures exactly,
otherwise the bar takes 4 cells up to the whole width.
fn rich_render( &self, console: &Console, options: &ConsoleOptions, ) -> Vec<Segment>
Source§fn fit_to_measurement(&self) -> bool
fn fit_to_measurement(&self) -> bool
Console::print shrinks this renderable to its
measured width. Upstream renders every top-level renderable at the full
console width, so the default is false; an extension may opt in.