This is a library that displays the loading in the terminal
, used when the program is waiting
, or when the progress
needs to be displayed, to improve the user experience.
Add this in your Cargo.toml
:
toml
[dependencies]
loading = "*"
```rust use loading::Loading; use std::thread; use std::time::Duration;
fn main() { let mut loading = Loading::new();
loading.start();
for i in 0..100 {
loading.text(format!("Loading {}", i));
thread::sleep(Duration::from_millis(50));
}
loading.success("OK");
loading.end();
}
```
cargo run --example status
cargo run --example download