[−][src]Function winconsole::console::get_state
pub fn get_state(copy_output: bool, copy_all: bool) -> WinResult<ConsoleState>
Returns a ConsoleState
object containing information about the current state of the console.
Arguments
copy_output
- Should the state contain information about the output buffer?copy_all
- Should the state copy all of the output buffer (as opposed to reading the buffer from the start to the current cursor position)?
Examples
Retrieves the state of the console, copying the output up to the location of the console cursor.
let state = console::get_state(true, false).unwrap(); println!("{}", state.output.len());
Errors
FromUtf8Error
: Returned if an error occurs while converting to a string.InvalidHandleError
: Returned if an invalid handle to the console output is retrieved or used.IoError
: Returned if an OS error occurs.