pub struct Console { /* private fields */ }
Expand description
Console represents a terminal session with opened stdin, stdout and stderr.
Implementations§
source§impl Console
impl Console
sourcepub fn current() -> Result<Self, Error>
pub fn current() -> Result<Self, Error>
Creates a console from default stdin, stdout and stderr.
sourcepub fn set_raw(&self) -> Result<(), Error>
pub fn set_raw(&self) -> Result<(), Error>
Sets terminal in a raw mode. Raw mode is a mode where most of consoles processing is ommited.
sourcepub fn reset(&self) -> Result<(), Error>
pub fn reset(&self) -> Result<(), Error>
Sets terminal in a mode which was initially used on handles.
sourcepub fn is_stdin_empty(&self) -> Result<bool, Error>
pub fn is_stdin_empty(&self) -> Result<bool, Error>
Verifies if there’s something in stdin to read.
It can be used to determine if the call to [std::io::stdin].read()
will block