spinoff/examples/all_spinners.rs

13 lines
359 B
Rust
Raw Permalink Normal View History

2022-07-16 18:33:16 -05:00
use spinoff::{Spinner, Spinners};
use std::{thread::sleep, time::Duration};
2022-07-15 12:59:22 -05:00
use strum::IntoEnumIterator;
2022-07-16 18:33:16 -05:00
2022-07-15 12:59:22 -05:00
fn main() {
2022-07-16 18:33:16 -05:00
let mut spin = Spinner::new(Spinners::Dots, "", None);
2022-07-15 12:59:22 -05:00
for spinner in Spinners::iter() {
2022-07-18 03:46:33 -05:00
spin.update(spinner, format!("{}", spinner), None);
2022-07-16 18:33:16 -05:00
sleep(Duration::from_secs(2));
2022-07-15 12:59:22 -05:00
}
2022-07-16 18:33:16 -05:00
spin.stop_with_message("Done!");
2022-07-15 12:59:22 -05:00
}