Crate superconsole

Source
Expand description

The superconsole crate provides a handler and building blocks for powerful, yet minimally intrusive TUIs. Built on-top of crossterm, it cross-compiles on Windows 7+, Linux, and MacOS.

Rendering is handled by SuperConsole, which draws to stdout. The caller is responsible for re-rendering whenever necessary. User input will cause aberrations in output; similarly, one should also not produce output from other sources while superconsole is active.

The rendering can be divided into two principle components:

  • In the scratch area, the previous content is overwritten at each render.
  • In the emitted area, lines scroll away above the scratch with various diagnostic output. Components live in the scratch area.

A set of pre-baked composition and testing oriented components are provided in the components module.

Re-exports§

pub use components::Component;
pub use components::DrawMode;
pub use content::Line;
pub use content::Lines;
pub use content::Span;
pub use crate::builder::Builder;

Modules§

builder
components
Getting started truly from scratch is excessive for every user of superconsole. A small set of starter components are provided, exposed below.
content
Provides a variety of utilities for working with Lines.
output
style
Provides stylization for Strings.
testing
Testing utilities for Superconsole.

Structs§

Dimensions
Denotes a rectangular area.
SuperConsole
Handles rendering the console using the user-defined Components and emitted messages. A Canvas area at the bottom of the terminal is re-rendered in place at each tick for the components, while a log area of emitted messages is produced above. Producing output from sources other than SuperConsole while break the TUI.

Enums§

Direction
Denotes a particular axis (x or y). Used for several Components which are generalized over direction.