Skip to main content

Module spinner

Module spinner 

Source
Expand description

Animated spinner — ports @clack/prompts spinner().

Runs an animation thread on stderr until stop, cancel, or error is called. Supports a live message update via Spinner::message.

§Example

use cli_ui::prompt::spinner;

let s = spinner();
s.start("Installing dependencies");
std::thread::sleep(std::time::Duration::from_millis(800));
s.message("Resolving graph");
std::thread::sleep(std::time::Duration::from_millis(800));
s.stop("Installed 42 packages");

Structs§

Spinner
Handle returned from spinner(). All methods are safe to call from any thread.

Enums§

Indicator

Functions§

spinner
Create a new spinner. Call Spinner::start to begin animating.