pub struct Spinner { /* private fields */ }Implementations§
Source§impl Spinner
impl Spinner
Sourcepub fn new(frames: Vec<&'static str>) -> Self
pub fn new(frames: Vec<&'static str>) -> Self
Create a Spinner
let spin = Spinner::new(vec!["∙∙∙", "●∙∙", "∙●∙", "∙∙●"])let spin = Spinner::new(vec!["+", "-", "*", "/"])Examples found in repository?
examples/spinner.rs (line 6)
5fn main() {
6 let loading = Loading::with_stdout(Spinner::new(vec!["◐", "◓", "◑", "◒"]));
7 for i in 0..10 {
8 loading.text(format!("Loading {}", i));
9 thread::sleep(Duration::from_millis(200));
10 }
11 loading.success("Successs ...");
12 loading.end();
13
14 let loading = Loading::with_stderr(Spinner::new(vec!["∙∙∙", "●∙∙", "∙●∙", "∙∙●"]));
15 for i in 0..10 {
16 loading.text(format!("Loading {}", i));
17 thread::sleep(Duration::from_millis(200));
18 }
19 loading.fail("Error ...");
20 loading.end();
21}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Spinner
impl RefUnwindSafe for Spinner
impl Send for Spinner
impl Sync for Spinner
impl Unpin for Spinner
impl UnwindSafe for Spinner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more