Expand description
Console representation and manipulation.
Re-exports§
pub use graphics::GraphicsConsole;
Modules§
- drawing
- Drawing algorithms for consoles that don’t provide native rendering primitives.
- graphics
- Support to implement graphical consoles.
Structs§
- CharsXY
- Represents a coordinate for character-based console operations.
- Line
Buffer - Abstraction over a string to handle manipulation operations at char boundaries.
- PixelsXY
- Represents a coordinate for pixel-based console operations.
- Size
InPixels - Represents a rectangular size in pixels.
- Trivial
Console - Implementation of the EndBASIC console with minimal functionality.
Enums§
- Ansi
Color - Identifiers for the basic ANSI colors.
- Clear
Type - Indicates what part of the console to clear on a
Console::clear()
call. - Key
- Decoded key presses as returned by the console.
Traits§
- Console
- Hooks to implement the commands that manipulate the console.
Functions§
- ansi_
color_ to_ rgb - Converts an ANSI color number to an RGB color.
- get_
env_ var_ as_ u16 - Gets the value of the environment variable
name
and interprets it as au16
. ReturnsNone
if the variable is not set or if its contents are invalid. - has_
control_ chars - Checks if a given string has control characters.
- is_
narrow - Returns true if the console is too narrow for the standard interface.
- read_
key_ from_ stdin - 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
. - read_
line - 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 withprevious
. - read_
line_ secure - Reads a line from the console without echo using the given
prompt
. - refill_
and_ print - Same as
refill
but prints the lines of each paragraph to the console instead of returning them and prefixes them with an optionalindent
. - remove_
control_ chars - Removes control characters from a string to make it suitable for printing.
Type Aliases§
- RGB
- Represents an RGB color in
[0,255]
quantities.