Giter Site home page Giter Site logo

stati's Introduction

stati

Rust library for progress bars

WARNING

This crate is still in development, and although it should be fine to use, things may change at any time

Crate Features

  • fairness:
    • enables using parking_lot's FairMutex
    • (adds some overhead but may fix some issues?)
  • nightly:
    • enables using nighlty rust (generic_associated_types) for some extra optimizations

Installation

Add this line to your Cargo.toml

stati = "0.11.0-beta"

Usage

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");

Why?

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.

Lisence

MIT, see LICENSE

TODO's

  • add fun spini spinner wheeeeeeeeeeeeeeeeee
  • non-nightly support
  • add optional nightly features
  • add builder pattern support for making progress bars
  • multithreading!
  • windows support
  • improve docs
  • improve tests
  • improve examples
  • better iterator tracking
  • create bar style with string formatting like indicatif?
  • update to use Vec::drain_filter once it is stableized
  • make bars use better formatting

stati's People

Contributors

rowan-sl avatar gimbling-away avatar

Stargazers

Abraham Tugalov avatar Matteo Rosato avatar  avatar  avatar

Watchers

 avatar

Forkers

fekie

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.