[][src]Trait crossterm_screen::IntoRawMode

pub trait IntoRawMode: Write + Sized {
    fn into_raw_mode(self) -> Result<RawScreen>;
}

Allows to enable raw mode.

Why this type must be implemented on writers?

TTYs has their state controlled by the writer, not the reader. You use the writer to clear the screen, move the cursor and so on, so naturally you use the writer to change the mode as well.

Examples

use std::io::stdout;
use crossterm_screen::IntoRawMode;
use crossterm_utils::Result;

fn main() -> Result<()> {
    let stdout = stdout();
    let _raw = stdout.into_raw_mode()?;

    // Do something in the raw mode

    Ok(())
} // `_raw` dropped here <- raw mode disabled

Required methods

fn into_raw_mode(self) -> Result<RawScreen>

Enables raw mode.

Loading content...

Implementations on Foreign Types

impl IntoRawMode for Stdout[src]

Loading content...

Implementors

Loading content...