Crates.io | stati |
lib.rs | stati |
version | 0.11.0-beta |
source | src |
created_at | 2022-01-30 23:26:14.813865 |
updated_at | 2022-02-28 00:51:41.270357 |
description | A library for progress (bars) |
homepage | |
repository | https://github.com/rowan-sl/stati/ |
max_upload_size | |
id | 524239 |
size | 38,224 |
Rust library for progress bars
This crate is still in development, and although it should be fine to use, things may change at any time
parking_lot
's FairMutex
Add this line to your Cargo.toml
stati = "0.11.0-beta"
This is a simple example of how to create and progress a progress bar
use std::thread;
extern crate stati;
use stati::prelude::*;
use stati::BarManager;
let mut manager = BarManager::new();
let mut bar = manager.register(bars::SimpleBar::new(&"Working...", 100));
for i in 0..=100 {
bar.bar().set_progress(i);
manager.print();
thread::sleep_ms(100);
}
To print text while using a progress bar, use the println
and print
macros like so
let mut manager = BarManager::new();
stati::println!(manager, "Made some progress");
Many progress bars that I have used in the past have suffered from issues such as not being able to have multiple bars at once, or not being able to print other messages while a bar was running. this crate aims to solve all of these issues, and generaly make it much nicer to use.
MIT, see LICENSE