Crates.io | rspinner |
lib.rs | rspinner |
version | 0.1.0 |
source | src |
created_at | 2024-04-23 07:23:56.697781 |
updated_at | 2024-05-10 02:33:46.472156 |
description | Elegant rust terminal spinner. |
homepage | https://github.com/loongzhu/rspinner |
repository | https://github.com/loongzhu/rspinner |
max_upload_size | |
id | 1217245 |
size | 59,341 |
rust spinner
See Cargo page
use rspinner::Spinner;
use std::thread::sleep;
use std::time::Duration;
fn main() {
let mut spinner = Spinner::new(Some("new spinner..."));
sleep(Duration::from_secs(2));
spinner.start(Some("Start - 1"));
sleep(Duration::from_secs(2));
spinner.success(Some("Success!"));
// spinner.error(Some("Has Error!"));
spinner.start(Some("Start - 2"));
sleep(Duration::from_secs(2));
spinner.error(Some("Has Error!"));
sleep(Duration::from_secs(1));
spinner.warning(None);
sleep(Duration::from_secs(1));
spinner.info(None);
}
cargo run --example run