Module termion::raw

source ·
Expand description

Managing raw mode.

Raw mode is a particular state a TTY can have. It signifies that:

  1. No line buffering (the input is given byte-by-byte).
  2. The input is not written out, instead it has to be done manually by the programmer.
  3. The output is not canonicalized (for example, \n means “go one line down”, not “line break”).

It is essential to design terminal programs.

§Example

use termion::raw::IntoRawMode;
use std::io::{Write, stdout};

fn main() {
    let mut stdout = stdout().into_raw_mode().unwrap();

    write!(stdout, "Hey there.").unwrap();
}

Structs§

  • A terminal restorer, which keeps the previous state of the terminal, and restores it, when dropped.

Constants§

Traits§

  • Types which can be converted into “raw mode”.