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.
- Console
Dimensions - Size of the terminal in cells.
- Console
Options - Options passed to renderables during rendering.
- DynRenderable
- A wrapper that provides
Clone+Debugfor 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).
- Render
Hook - A hook that can modify render output before display.
- Render
Result - The result of rendering: a list of lines, each line being a list of
segments. Also carries an optional
itemslist for recursive rendering. - Theme
Context - A RAII guard that restores a previous theme when dropped.
Enums§
- Capture
Error - Error type for capture operations.
- Overflow
Method - How to handle text that overflows the available width.
- Render
Item - A single item in a render result — either a final
Segmentor a nested renderable that will be recursively flattened byConsole::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, andprint_json_val.