Skip to main content

Module text

Module text 

Source
Expand description

Styled text primitives: Span and Line.

Structs§

Line
A horizontal sequence of Spans rendered as a single line.
Span
A string with an associated Style.

Functions§

char_width
The number of terminal cells a single character occupies.
split_at_width
Splits s at the byte index where its display width reaches max_cols.
truncate_measured
Splits s at the byte index where its display width reaches max_cols, returning the prefix’s own measured width alongside it.
width
The number of terminal cells s occupies, saturating at u16::MAX.
width_usize
The number of terminal cells s occupies, without saturating to u16.