Module endbasic_std::console

source ·
Expand description

Console representation and manipulation.

Structs

Represents a coordinate for character-based console operations.
Abstraction over a string to handle manipulation operations at char boundaries.
Represents a coordinate for pixel-based console operations.
Represents a rectangular size in pixels.
Implementation of the EndBASIC console with minimal functionality.

Enums

Identifiers for the basic ANSI colors.
Indicates what part of the console to clear on a Console::clear() call.
Decoded key presses as returned by the console.

Traits

Hooks to implement the commands that manipulate the console.

Functions

Converts an ANSI color number to an RGB color.
Gets the value of the environment variable name and interprets it as a u16. Returns None if the variable is not set or if its contents are invalid.
Checks if a given string has control characters.
Reads a single key from stdin when not attached to a TTY. Because characters are not visible to us until a newline is received, this reads complete lines and buffers them in memory inside the given buffer.
Reads a line from the console. If the console is interactive, this does fancy line editing and uses the given prompt and pre-fills the input with previous.
Reads a line from the console without echo using the given prompt.
Same as refill but prints the lines of each paragraph to the console instead of returning them and prefixes them with an optional indent.
Removes control characters from a string to make it suitable for printing.

Type Definitions

Represents an RGB color in [0,255] quantities.