Skip to main content

Module progress_tracker

Module progress_tracker 

Source
Expand description

Universal Progress Tracker

A reusable progress tracking utility that automatically detects terminal capabilities and provides appropriate output formatting for both TTY and non-TTY environments.

§Features

  • Automatic TTY detection
  • Thread-safe progress updates
  • Configurable update frequency
  • Clean output for both interactive and CI/CD environments

§Usage

use api_scanner::progress_tracker::ProgressTracker;

#[tokio::main]
async fn main() {
    let tracker = ProgressTracker::new(100); // 100 total items

    for _ in 0..100 {
        // Do work...
        tracker.increment(Some("Processing item")).await;
    }

    tracker.finish().await;
}

Structs§

ProgressConfig
Configuration for progress tracking behavior
ProgressHandle
Cloneable handle for use in async tasks
ProgressTracker
Thread-safe progress tracker