Module stdcli::term [] [src]

Exports a unified terminal interface.

There are several small crates in rust which are intended to be used together to create better terminal interfaces. This module combines their types and exports them together.

See the documents for each of the respective crates.

Modules

console

console is a library for Rust that provides access to various terminal features so you can build nicer looking command line interfaces. It comes with various tools and utilities for working with Terminals and formatting text.

dialoguer

dialogue is a library for Rust that helps you build useful small interactive user inputs for the command line. It provides utilities to render various simple dialogs like confirmation prompts, text inputs and more.

indicatif

indicatif is a library for Rust that helps you build command line interfaces that report progress to users. It comes with various tools and utilities for formatting anything that indicates progress.

tabwriter

This crate provides an implementation of elastic tabstops. It is a minimal port of Go's tabwriter package. Namely, its main mode of operation is to wrap a Writer and implement elastic tabstops for the text written to the wrapped Writer.

Structs

AnsiCodeIterator

An iterator over ansi codes in a string.

Checkboxes

Renders a multi select checkbox menu.

Confirmation

Renders a simple confirmation prompt.

Editor

Launches the default editor edit a string.

Emoji

"Intelligent" emoji formatter.

FormattedDuration

Wraps an std duration for human basic formatting.

HumanBytes

Formats bytes for human readability

HumanDuration

Wraps an std duration for human readable formatting.

Input

Renders a simple input prompt.

MultiProgress

Manages multiple progress bars from different threads.

PasswordInput

Renders a password input prompt.

ProgressBar

A progress bar or spinner.

ProgressBarIter
ProgressDrawTarget

Target for draw operations

ProgressStyle

Controls the rendering style of progress bars.

Select

Renders a selection menu.

Style

A stored style that can be applied.

StyledObject

A formatting wrapper that can be styled for a terminal.

Term

Abstraction around a terminal.

Enums

Alignment

Defines the alignment for padding operations.

Attribute

A terminal style attribute.

Color

A terminal color.

Key

Key mapping

Functions

colors_enabled

Returns true if colors should be enabled.

measure_text_width

Measure the width of a string in terminal characters.

pad_str

Pads a string to fill a certain number of characters.

set_colors_enabled

Forces colorization on or off.

strip_ansi_codes

Helper function to strip ansi codes.

style

Wraps an object for formatting for styling.

truncate_str

Truncates a string to a certain number of characters.

user_attended

A fast way to check if the application has a user attended.