Skip to content

Treeniks/throbber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Throbber

Crates.io docs.rs GitHub last commit License

This crate serves as an alternative to loading. It is used to display a throbber animation in the terminal while other calculations are done in the main program.

Throbber Preview

Example

use std::thread;
use std::time::Duration;
use throbber::Throbber;

fn main() {
    let mut throbber = Throbber::default().message("calculating stuff");

    throbber.start();
    // do stuff
    thread::sleep(Duration::from_secs(2));
    throbber.success("Success");

    throbber.start_with_msg("calculating more stuff");
    // do other stuff
    thread::sleep(Duration::from_secs(2));
    throbber.fail("Fail");
}

About

A rust crate to display throbber animations on the terminal

Topics

Resources

License

Stars

Watchers

Forks

Languages