throbberous 0.1.4

An async-native CLI progress bar and throbber (spinner) library for Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use throbberous::Bar;
use tokio::time::{sleep, Duration};

#[tokio::main]
async fn main() {
    println!("Simple Progress Bar Demo:");
    
    let bar = Bar::new(100);
    
    for _i in 0..100 {
        bar.inc(1).await;
        sleep(Duration::from_millis(50)).await;
        // Messages automatically change: "Working..." -> "Quarter done" -> "Halfway done" -> "Almost there..." -> "Complete!"
    }
    
    bar.finish().await;
    println!("Done!");
}