Skip to main content

Module text

Module text 

Source
Expand description

Rich text module - the core text manipulation type.

This module provides the Text type which represents styled terminal text, along with supporting types Span, Lines, and related enums. Port of Python’s rich/text.py.

Re-exports§

pub use enums::JustifyMethod;
pub use enums::OverflowMethod;

Modules§

enums
Text enums for justification and overflow handling.

Structs§

Lines
A collection of Text lines, typically produced by wrapping or splitting.
Span
A styled range within a Text object.
Text
Rich text with styles, spans, and formatting metadata.

Enums§

TextOrStr
Either a string slice or a Text reference, for use with Text::append.
TextPart
A building block for Text::assemble, representing one segment of text.

Functions§

strip_control_codes
Strip control codes from text (Bell, Backspace, VT, FF, CR).