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§
- Progress
Config - Configuration for progress tracking behavior
- Progress
Handle - Cloneable handle for use in async tasks
- Progress
Tracker - Thread-safe progress tracker