loaders 0.0.0

A fully-featured, customisable progress bar and loading indicator library for Rust CLI and terminal applications
Documentation
use loaders::{ProgressIterator, ProgressStyle};
use std::thread;
use std::time::Duration;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    for _ in (0..1000u64).progress() {
        thread::sleep(Duration::from_micros(250));
    }

    let values: Vec<_> = (1..=5).collect();
    let style = ProgressStyle::with_template("vec [{bar:20}] {pos}/{len}")?;
    for _ in values.iter().progress_with_style(style) {
        thread::sleep(Duration::from_millis(20));
    }

    let unknown = (0..).take(500);
    for _ in unknown.progress_count(500) {
        thread::sleep(Duration::from_micros(200));
    }

    let sum: u64 = (0..100u64).progress().sum();
    println!("sum = {sum}");

    let evens: Vec<_> = (0..1000).filter(|n| n % 2 == 0).progress().collect();
    println!("collected {} even numbers", evens.len());

    Ok(())
}