Module andiskaz::string

source ·
Expand description

This module provides a string type used to be printed to the terminal. It is called “TermString”. You can use the macro tstring! to build a TermString as a shortcut for TermString::new_lossy.

This module also provides a type TermGrapheme, which corresponds to what a human sees as a single character (“grapheme cluster”). It might be composed of a single unicode codepoint or of several. However, TermGraphemes made of several characters are not portable, as Windows’ cmd by default prints the multiple characters of a grapheme separatedly, while most Linux ANSI terminals will print them together if they form a single grapheme cluster.

To concat TermStrings and TermGraphemes together you can use the macro tstring_concat!.

Structs

Enums

Traits

  • Specifies usable indices for a TermString.