mimir_progress 0.1.0

A terminal progress bar with highly configurable intervals.
Documentation
  • Coverage
  • 62.5%
    10 out of 16 items documented0 out of 11 items with examples
  • Size
  • Source code size: 25.35 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 390.88 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mwcz

mimir_progress

A terminal progress bar library for Rust.

Features

  • Configurable update intervals: time-based, count-based, or percentage-based
    • For instance, in CI/CD an update could be issued every 1000ms to avoid spamming the logs, or every 30ms for rapid updates in an interactive environment
  • Displays elapsed time, estimated remaining time, and processing rate
  • Optional same-line rendering (can be disabled for CI environments)
  • Customizable message prefix

Usage

use mimir_progress::{Progress, ProgressInterval};
use std::time::Duration;

// Update every 2 seconds
let mut pb = Progress::new(1000, ProgressInterval::Time(Duration::from_secs(2)));

// Or update every 100 items
let mut pb = Progress::new(1000, ProgressInterval::Count(100));

// Or update every 10%
let mut pb = Progress::new(1000, ProgressInterval::Percent(10));

pb.set_prefix("Processing: ".to_string());

for _ in 0..1000 {
    // do work
    pb.inc();
}

Dependencies

  • humantime - Duration formatting
  • termion - Terminal control sequences