Rust crate that allows you to display status & progress information in a terminal

Overview

status-line

This crate allows you to display status & progress information in a terminal

Crates.io Documentation License: MIT

This crate handles the problem of displaying a small amount of textual information in a terminal, periodically refreshing it, and finally erasing it, similar to how progress bars are displayed.

A status line can be viewed as a generalization of a progress bar. Unlike progress bar drawing crates, this crate does not require that you render the status text as a progress bar. It does not enforce any particular data format or template, nor it doesn't help you with formatting.

The status line text may contain any information you wish, and may even be split into multiple lines. You fully control the data model, as well as how the data gets printed on the screen. The standard Display trait is used to convert the data into printed text.

Status updates can be made with a very high frequency, up to tens of millions of updates per second. StatusLine decouples redrawing rate from the data update rate by using a background thread to handle text printing with low frequency.

Example

use std::fmt::{Display, Formatter};
use std::sync::atomic::{AtomicU64, Ordering};
use status_line::StatusLine;

// Define the data model representing the status of your app.
// Make sure it is Send + Sync, so it can be read and written from different threads:
struct Progress(AtomicU64);

// Define how you want to display it:
impl Display for Progress {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}%", self.0.load(Ordering::Relaxed))
    }
}

// StatusLine takes care of displaying the progress data:
let status = StatusLine::new(Progress(AtomicU64::new(0)));   // shows 0%
status.0.fetch_add(1, Ordering::Relaxed);                    // shows 1%
status.0.fetch_add(1, Ordering::Relaxed);                    // shows 2%
drop(status)                                                 // hides the status line
You might also like...
A terminal clock that uses 7-segment display characters

Seven-segment clock (7clock) 7clock.3.mp4 This is a clock for terminals that uses the Unicode seven-segment display characters added in Unicode 13.0.

A little application that makes it possible to display mpv's subs anywhere you want.

Mpv Subs Popout A little application that makes it possible to display mpv's subs anywhere you want. Why? You can now watch shows in foreign languages

Terminal information for Rust.

terminfo Terminal capabilities with type-safe getters. Usage Add this to your Cargo.toml: [dependencies] terminfo = "0.1" and this to your crate root:

Rust-battery - Rust crate providing cross-platform information about the notebook batteries.

battery Rust crate providing cross-platform information about the notebook batteries. Table of contents Overview Supported platforms Install Examples

Github user information on terminal :D
Github user information on terminal :D

octofetch Use this if youre too lazy to open github lol Installation Local install with cargo Run cargo install --git https://github.com/azur1s/octofe

Rust CLI utility library. Error handling, status reporting, and exit codes.
Rust CLI utility library. Error handling, status reporting, and exit codes.

narrate This library provides CLI application error and status reporting utilities. The coloured output formatting aims to be similar to Cargo. Error

Check the reproducibility status of your Arch Linux packages (read-only mirror)
Check the reproducibility status of your Arch Linux packages (read-only mirror)

arch-repro-status A CLI tool for querying the reproducibility status of the Arch Linux packages using data from a rebuilderd instance such as reproduc

Easy, Simple, Clean. Making status bars reliable and up-to-date.

Simple Status Easy, Simple, Clean. Making status bars reliable and up-to-date. Installation Compiling simple_status yourself doesn't require much. Ins

An eye that keeps track of your Roblox status and shares it with others
An eye that keeps track of your Roblox status and shares it with others

Roblox presence for Discord with only one native standalone executable that relies on zero external dependencies, and doesn't need to be installed.

Owner
Piotr Kołaczkowski
Piotr Kołaczkowski
A super simple but lightweight logging library that tries to capture the most important (status) information.

Hackerlog A super simple but lightweight logging library that tries to capture the most important (status) information. The following is supported: Lo

434b 3 Aug 22, 2023
Rust code for T-Display S3 AMOLED, ESP32-S3 board with RM67162 AMOLED display

T-Display S3 AMOLED What is it? This is a Rust BSP for the Lilygo's T-Display S3 AMOLED board. RM67162 AMOLED driver in QSPI mode RM67162 AMOLED drive

BH1XUW 4 Jun 28, 2023
Display a random Shiba from your terminal whenever you feel the need to. Because why not?

Shiba CLI Command-line interface (CLI) to display a random Shiba Inu whenever needed, by just running shiba on your terminal. How To Use • How Does It

null 17 Sep 25, 2022
Rust Crate that allows to do interruptions in console. Will be implemented to functional terminal customization kit.

termpause Rust Crate that allows to do interruptions in console. Will be implemented to functional terminal customization kit. Usage Add this in your

Just Said 4 Sep 21, 2022
Web-based tool that allows browsing and comparing symbol and type information of Microsoft Windows binaries across different versions of the OS.

WinDiff About WinDiff is an open-source web-based tool that allows browsing and comparing symbol and type information of Microsoft Windows binaries ac

Erwan Grelet 208 Jun 15, 2023
A crate that allows you to mostly-safely cast one type into another type.

A crate that allows you to mostly-safely cast one type into another type. This is mostly useful for generic functions, e.g. pub fn foo<S>(s: S) {

Bincode 3 Sep 23, 2023
Sero is a web server that allows you to easily host your static sites without pain. The idea was inspired by surge.sh but gives you full control.

sero Lightning-fast, static web publishing with zero configuration and full control ?? Table Of Contents ?? Table Of Contents ?? Tools ❓ About The Pro

Dmitry Miasnenko 6 Nov 13, 2023
Work in progress NCBI's Common Tree alternative in the terminal

Lomanai Usage lomanai --species 'Mus musculus' --species 'Homo sapiens' #> Mammalia #> ++Rodentia #> | \-Mus musculus #> \+Primates #> \-Homo sapien

Jean Manguy 3 Dec 20, 2022
Display financial Data on The Terminal

tuinance Tuinance is a performant TUI program to display financial data, written completely in Rust. All data is gathered through the Yahoo Finance AP

Juho 10 May 31, 2022
Display candlestick chart in your terminal.

cli-candlestick-chart This module allows you to display candle charts directly in your terminal. I did this project mainly to learn Rust, so the code

Julien 178 Dec 18, 2022