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

Modules

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

Structs

  • Denotes a rectangular area.
  • 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

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