Crate fast_rich

Crate fast_rich 

Source
Expand description

§fast-rich

A Rust port of Python’s Rich library for beautiful terminal formatting.

§Features

  • Rich text with colors, styles, and markup
  • Tables with Unicode borders and auto-sizing
  • Progress bars with multiple tasks, spinners, and customizable columns
  • Live Display for flicker-free auto-updating content
  • Logging handler for colorful structured logs
  • Tree views for hierarchical data
  • Panels and Rules for visual organization
  • Markdown rendering (optional)
  • Syntax highlighting (optional)
  • Pretty tracebacks for better error display

§Quick Start

use fast_rich::prelude::*;

let console = Console::new();

// Simple styled output
console.print("Hello, [bold magenta]World[/]!");

// Tables
let mut table = Table::new();
table.add_column("Name");
table.add_column("Age");
table.add_row_strs(&["Alice", "30"]);
console.print_renderable(&table);

Re-exports§

pub use console::Console;
pub use layout::Layout;
pub use live::Live;
pub use panel::BorderStyle;
pub use panel::Panel;
pub use renderable::Renderable;
pub use rule::Rule;
pub use style::Color;
pub use style::Style;
pub use table::Column;
pub use table::ColumnAlign;
pub use table::Table;
pub use text::Alignment;
pub use text::Text;
pub use tree::Tree;
pub use tree::TreeNode;

Modules§

align
Alignment wrapper for renderables.
bar
Bar charts for visualizing data.
box_drawing
Box drawing characters and styles.
columns
Multi-column layout for displaying content in columns.
console
Console abstraction for terminal output.
emoji
Emoji name to Unicode character mapping.
filesize
Filesize formatting utilities.
group
Render groups for combining multiple renderables.
highlighter
Highlighters for pattern-based text styling.
inspect
Introspection tools for debugging.
layout
live
log
Logging utilities similar to Rich’s console.log().
markup
Markup parser for Rich-style markup syntax.
measure
Measure API for calculating renderable dimensions.
nested_progress
Nested progress bars support.
padding
Padding wrapper for renderables.
pager
Pager for interactive output pagination.
panel
Panels for displaying content in a box with optional title.
prelude
Prelude module for convenient imports.
progress
Progress bars, spinners, and status indicators.
prompt
Interactive prompt module.
renderable
The Renderable trait defines objects that can be rendered to the console.
rule
Horizontal rules for visual separation.
screen
Alternate screen support for full-screen terminal applications.
style
Style and color types for terminal output.
table
Tables for displaying structured data.
text
Text and Span types for styled text with wrapping and alignment.
theme
Theme system for consistent styling.
traceback
Pretty traceback/panic rendering.
tree
Tree rendering for hierarchical data.

Macros§

log
Macro for logging with file/line information.

Functions§

print
Print text with markup to stdout.
println
Print text with markup to stdout, followed by a newline.