Skip to main content

Module segment

Module segment 

Source
Expand description

Segment - the atomic rendering unit.

A Segment is a piece of text with a single style applied. The rendering pipeline produces streams of segments that are then written to the terminal.

Structs§

ControlCode
A control code with optional parameters.
Segment
The atomic unit of rendering.

Enums§

ControlType
Control codes for terminal manipulation.

Functions§

adjust_line_length
Adjust line length by padding or truncating.
align_bottom
Align lines to the bottom of a given height.
align_middle
Align lines to the middle of a given height.
align_top
Align lines to the top of a given height.
apply_style
Apply styles to an iterator of segments.
divide
Divide segments at specified cell positions.
line_length
Get the total cell length of a line of segments.
simplify
Simplify segments by merging adjacent segments with identical styles.
split_lines
Split segments into lines at newline characters.