Crate scarb_ui

Source
Expand description

Terminal user interface primitives used by Scarb and its extensions.

This crate focuses mainly on two areas:

  1. Ui and components: Serving a unified interface for communication with the user, either via:
    • rendering human-readable messages or interactive widgets,
    • or printing machine-parseable JSON-NL messages, depending on runtime configuration.
  2. args: Providing reusable clap arguments for common tasks.

There are also re-export from various TUI crates recommended for use in Scarb ecosystem, such as indicatif or console.

Modules§

args
This module provides reusable clap arguments for common tasks in Scarb ecosystem.
components
This module provides various ready to use message types and widgets for use with a Ui.

Structs§

BinaryBytes
Formats bytes for human readability using ISO/IEC prefixes
DecimalBytes
Formats bytes for human readability using SI prefixes
FormattedDuration
Wraps an std duration for human basic formatting.
HumanBytes
Formats bytes for human readability
HumanCount
Formats counts for human readability using commas
HumanDuration
Wraps an std duration for human readable formatting.
HumanFloatCount
Formats counts for human readability using commas for floats
Ui
An abstraction around console output which stores preferences for output format (human vs JSON), colour, etc.

Enums§

OutputFormat
The requested format of output (either textual or JSON).
Verbosity
The requested verbosity of output.

Traits§

Message
A typed object that can be either printed as a human-readable message or serialized as JSON.
Widget
A persistent message that is only usable for humans, for example a spinner.