Skip to main content

Module console

Module console 

Source
Expand description

Central rendering engine — Console, Renderable trait, capture, export. Console — the central rendering engine. Equivalent to Rich’s console.py.

The Console is the main entry point for rendering. It manages terminal detection, color system support, and dispatching renderables to produce styled output.

Re-exports§

pub use crate::pager::Pager;
pub use crate::pager::PagerContext;
pub use crate::pager::SystemPager;

Structs§

Capture
Captured console output. Created by Console::end_capture.
Console
The main console for rendering rich output.
ConsoleDimensions
Size of the terminal in cells.
ConsoleOptions
Options passed to renderables during rendering.
DynRenderable
A wrapper that provides Clone + Debug for trait-object renderables.
Group
A renderable that renders multiple children one after another (vertically).
NewLine
A renderable that outputs a single newline.
NoChange
A renderable that outputs nothing (used as a sentinel).
RenderHook
A hook that can modify render output before display.
RenderResult
The result of rendering: a list of lines, each line being a list of segments. Also carries an optional items list for recursive rendering.
ThemeContext
A RAII guard that restores a previous theme when dropped.

Enums§

CaptureError
Error type for capture operations.
OverflowMethod
How to handle text that overflows the available width.
RenderItem
A single item in a render result — either a final Segment or a nested renderable that will be recursively flattened by Console::render().

Traits§

Renderable
Trait for anything that can be rendered to the console.

Functions§

get_console
Get a reference to the global Console.
print_json_val
Print formatted JSON.
print_objects
Print objects using the global console.
print_str
Print a string with markup support.
reconfigure
Reconfigure the global Console singleton with new dimensions and/or color system. This updates the shared global console instance used by print_objects, print_str, and print_json_val.