pub struct Spinner { /* private fields */ }

Implementations

Create a new spinner along with a message

Examples

Basic Usage:

use spinners::{Spinner, Spinners};

let sp = Spinner::new(Spinners::Dots, "Loading things into memory...".into());

No Message:

use spinners::{Spinner, Spinners};

let sp = Spinner::new(Spinners::Dots, String::new());

Create a new spinner that logs the time since it was created

Stops the spinner

Stops the spinner that was created with the Spinner::new function.

Optionally call stop_with_newline to print a newline after the spinner is stopped, or the stop_with_message function to print a message after the spinner is stopped.

Examples

Basic Usage:

use spinners::{Spinner, Spinners};

let mut sp = Spinner::new(Spinners::Dots, "Loading things into memory...".into());

sp.stop();

Stop with a symbol that replaces the spinner

The symbol is a String rather than a Char to allow for more flexibility, such as using ANSI color codes.

Examples

Basic Usage:

use spinners::{Spinner, Spinners};

let mut sp = Spinner::new(Spinners::Dots, "Loading things into memory...".into());

sp.stop_with_symbol("🗸");

ANSI colors (green checkmark):

use spinners::{Spinner, Spinners};

let mut sp = Spinner::new(Spinners::Dots, "Loading things into memory...".into());

sp.stop_with_symbol("\x1b[32m🗸\x1b[0m");

Stops the spinner and prints a new line

Examples

Basic Usage:

use spinners::{Spinner, Spinners};

let mut sp = Spinner::new(Spinners::Dots, "Loading things into memory...".into());

sp.stop_with_newline();

Stops the spinner and prints the provided message

Examples

Basic Usage:

use spinners::{Spinner, Spinners};

let mut sp = Spinner::new(Spinners::Dots, "Loading things into memory...".into());

sp.stop_with_message("Finished loading things into memory!".into());

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.