API Reference

ItemSignatureDescriptionGuide
ProgressBarstruct ProgressBarThread-safe progress bar handle.Progress Bars
ProgressBarBuilderstruct ProgressBarBuilderBuilder for length, style, target, template, and throttling.Progress Bars
ProgressBar::newfn new(len: u64) -> ProgressBarCreates a measured bar.Progress Bars
ProgressBar::new_spinnerfn new_spinner() -> ProgressBarCreates an indeterminate bar.Spinners
ProgressBar::hiddenfn hidden() -> ProgressBarCreates a silent bar for tests.Advanced
ProgressBar::with_draw_targetfn with_draw_target(len, target) -> ProgressBarUses a custom draw target.Advanced
ProgressBar::with_stylefn with_style(len, style) -> ProgressBarCreates a bar with a custom style.Styling
ProgressBar::with_templatefn with_template(len, template) -> Result<ProgressBar, TemplateError>Creates a bar from a custom template.Styling
ProgressBar::builderfn builder() -> ProgressBarBuilderStarts builder configuration.Progress Bars
ProgressBarBuilder::templatefn template(self, template) -> Result<Self, TemplateError>Sets a custom template while building.Styling
inc / inc_byfn inc(&self, delta: u64)Advances position.Progress Bars
set_positionfn set_position(&self, pos: u64)Sets absolute position.Progress Bars
set_lengthfn set_length(&self, len: u64)Sets total length.Progress Bars
set_length_unknownfn set_length_unknown(&self)Clears the known total.Progress Bars
set_messagefn set_message(&self, msg)Sets {msg}.Styling
set_prefixfn set_prefix(&self, prefix)Sets {prefix}.Styling
set_postfixfn set_postfix(&self, postfix)Sets {postfix}.Styling
tickfn tick(&self)Advances spinner frame.Spinners
finishfn finish(&self)Completes the bar.Progress Bars
finish_with_messagefn finish_with_message(&self, msg)Completes with final message.Progress Bars
finish_with_symbolfn finish_with_symbol(&self, symbol, msg)Completes with a fixed prefix marker.Progress Bars
finish_and_clearfn finish_and_clear(&self)Completes and clears output.Progress Bars
abandonfn abandon(&self)Stops without finished state.Progress Bars
resetfn reset(&self)Reuses the bar from zero.Progress Bars
set_stylefn set_style(&self, style)Replaces visual style.Styling
set_templatefn set_template(&self, template) -> Result<(), TemplateError>Replaces style from a template.Styling
set_draw_deltafn set_draw_delta(&self, delta)Redraws after enough progress.Advanced
set_draw_ratefn set_draw_rate(&self, rate)Caps redraws per second.Advanced
enable_steady_tickfn enable_steady_tick(&self, interval)Starts background ticking.Spinners
printlnfn println(&self, msg: &str)Prints above the bar.Progress Bars
wrap_iterfn wrap_iter<I>(&self, iter: I)Uses a bar for an iterator.Examples
fractionfn fraction(&self) -> f64Returns completion ratio.Progress Bars
percentfn percent(&self) -> f64Returns completion percent.Progress Bars
remainingfn remaining(&self) -> Option<u64>Returns remaining work.Progress Bars
is_finishedfn is_finished(&self) -> boolReturns completion state.Progress Bars
is_abandonedfn is_abandoned(&self) -> boolReturns abandonment state.Progress Bars
Spinnerstruct SpinnerErgonomic spinner wrapper.Spinners
Spinner::successfn success(&self, msg)Stops with a success marker.Spinners
Spinner::failurefn failure(&self, msg)Stops with a failure marker.Spinners
Spinner::warningfn warning(&self, msg)Stops with a warning marker.Spinners
Spinner::infofn info(&self, msg)Stops with an informational marker.Spinners
MultiProgressstruct MultiProgressShared block for many bars.Multi Progress
ProgressStylestruct ProgressStyleTemplate, chars, colors, keys.Styling
ProgressCharsstruct ProgressCharsReusable fill, head, and empty characters.Styling
Themeenum ThemeBuilt-in style presets.Themes
Colorenum ColorANSI color value.Styling
ColorSpecstruct ColorSpecANSI text attributes.Styling
DrawTargetenum DrawTargetStdout, stderr, hidden, or writer.Advanced
terminal::detect::terminal_width_for_fdfn terminal_width_for_fd(fd: i32) -> usizeDetects width for stdout/stderr with fallback.Advanced
terminal::detect::terminal_height_for_fdfn terminal_height_for_fd(fd: i32) -> usizeDetects height for stdout/stderr with fallback.Advanced
terminal::detect::supports_interactive_outputfn supports_interactive_output(fd: i32) -> boolChecks interactive cursor-update support for a stream.Advanced
ProgressIteratortrait ProgressIteratorAdds .progress() methods.Examples
format_bytesfn format_bytes(u64) -> StringHuman byte count.Styling
format_durationfn format_duration(Duration) -> StringHuman duration.Styling