rspinner

Crates.iorspinner
lib.rsrspinner
version0.1.0
sourcesrc
created_at2024-04-23 07:23:56.697781
updated_at2024-05-10 02:33:46.472156
descriptionElegant rust terminal spinner.
homepagehttps://github.com/loongzhu/rspinner
repositoryhttps://github.com/loongzhu/rspinner
max_upload_size
id1217245
size59,341
Coder Poet (loongzhu)

documentation

README

rspinner

rust spinner

Install

See Cargo page

Usage

use rspinner::Spinner;
use std::thread::sleep;
use std::time::Duration;

fn main() {
    let mut spinner = Spinner::new(Some("new spinner..."));

    sleep(Duration::from_secs(2));

    spinner.start(Some("Start - 1"));

    sleep(Duration::from_secs(2));

    spinner.success(Some("Success!"));

    // spinner.error(Some("Has Error!"));

    spinner.start(Some("Start - 2"));

    sleep(Duration::from_secs(2));

    spinner.error(Some("Has Error!"));

    sleep(Duration::from_secs(1));

    spinner.warning(None);

    sleep(Duration::from_secs(1));

    spinner.info(None);
}

rspinner

Example

cargo run --example run
Commit count: 18

cargo fmt