AnsiEncoder¶
Stateless ANSI escape sequence encoder.
Constructors¶
create¶
Returns¶
- AnsiEncoder val^
Public Functions¶
move_to¶
Emit ESC[(row+1);(col+1)H — terminal coordinates are 1-indexed.
Parameters¶
Returns¶
set_fg¶
Emit ESC[{fg_code}m for the given color.
fun box set_fg(
color: (Default val | Black val | Red val |
Green val | Yellow val | Blue val |
Magenta val | Cyan val | White val |
BrightBlack val | BrightRed val | BrightGreen val |
BrightYellow val | BrightBlue val | BrightMagenta val |
BrightCyan val | BrightWhite val | Rainbow val))
: Array[U8 val] val
Parameters¶
- color: (Default val | Black val | Red val | Green val | Yellow val | Blue val | Magenta val | Cyan val | White val | BrightBlack val | BrightRed val | BrightGreen val | BrightYellow val | BrightBlue val | BrightMagenta val | BrightCyan val | BrightWhite val | Rainbow val)
Returns¶
set_bg¶
Emit ESC[{bg_code}m for the given color.
fun box set_bg(
color: (Default val | Black val | Red val |
Green val | Yellow val | Blue val |
Magenta val | Cyan val | White val |
BrightBlack val | BrightRed val | BrightGreen val |
BrightYellow val | BrightBlue val | BrightMagenta val |
BrightCyan val | BrightWhite val | Rainbow val))
: Array[U8 val] val
Parameters¶
- color: (Default val | Black val | Red val | Green val | Yellow val | Blue val | Magenta val | Cyan val | White val | BrightBlack val | BrightRed val | BrightGreen val | BrightYellow val | BrightBlue val | BrightMagenta val | BrightCyan val | BrightWhite val | Rainbow val)
Returns¶
set_attrs¶
Emit an SGR sequence for each set attribute bit. Bold=1, dim=2, underline=4, blink=5, reverse=7.
Parameters¶
- attrs: U8 val
Returns¶
reset¶
Emit ESC[0m to reset all attributes and colors.
Returns¶
write_char¶
Encode a Unicode codepoint as UTF-8 bytes.
Parameters¶
- codepoint: U32 val
Returns¶
hide_cursor¶
Emit ESC[?25l to hide the cursor.
Returns¶
show_cursor¶
Emit ESC[?25h to show the cursor.
Returns¶
clear_screen¶
Emit ESC[2J to clear the entire screen.
Returns¶
eq¶
Parameters¶
- that: AnsiEncoder val
Returns¶
- Bool val
ne¶
Parameters¶
- that: AnsiEncoder val
Returns¶
- Bool val