[−][src]Function winconsole::console::set_state
pub fn set_state(
state: &ConsoleState,
clear: bool,
write_output: bool
) -> WinResult<()>
Sets the state of the console to a ConsoleState.
Arguments
state- AConsoleStatecontaining state information.clear- Should the console be cleared before writing to the output?write_output- Should the stored text be written to the output?
Examples
println!("Message 1."); let state = console::get_state(true, false).unwrap(); println!("Message 2."); console::set_state(&state, true, true).unwrap(); println!("Great Scott!");
Errors
ArgumentError: Returned if data in the state is invalid.FromUtf8Error: Returned if an error occurs while converting to a string.InvalidHandleError: Returned if an invalid handle to the console input/output is retrieved or used.IoError: Returned if an OS error occurs.