Crate throbberous

Source
Expand description

throbberous

An async-native CLI progress bar and throbber (spinner) library for Rust.

§Example

use throbberous::{Throbber, Bar};
use tokio_test::block_on;

block_on(async {
    // Regular progress bar
    let bar = Bar::new(100);
    for _i in 0..100 {
        bar.inc(1).await;
        tokio::time::sleep(tokio::time::Duration::from_millis(50)).await;
    }
    bar.finish().await;

    // Indeterminate progress bar
    let loading = Bar::indeterminate("Working...");
    tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;
    loading.finish().await;

    // Spinner
    let throbber = Throbber::new();
    throbber.start().await;
    tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
    throbber.stop().await;
});

Structs§

Bar
BarConfig
Throbber
ThrobberConfig

Enums§

BarMode