[−][src]Function winconsole::console::read_output
pub fn read_output(
column: u16,
row: u16,
max_length: impl Into<Option<u32>>
) -> WinResult<String>
Reads a string from the console output starting at a specified location. Note that this method reads the output buffer directly (i.e., an empty end of a line will be made up of multiple space characters rather than a newline character sequence).
Arguments
column
- The column at which reading should begin.row
- The row at which reading should begin.max_length
- The maximum amount of characters to read. If None, the entire output buffer is read.
Examples
Reads the entire console output buffer.
let output = console::read_output(0, 0, None).unwrap(); println!("{}", output.len());
Errors
ArgumentError
: Returned ifcolumn
orrow
is not within the output buffer.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.