[−][src]Function crossterm_utils::write_str
pub fn write_str(
stdout: &Option<&Arc<TerminalOutput>>,
string: &str
) -> Result<usize>
This function is used by 'ANSI' modules. Those modules are using an Option
of TerminalOutput
.
Because it is an option it could be either 'None' or 'Some'.
When the TerminalOutput
is 'None' we write our 'ANSI' escape codes to the default stdout()
if it is a Some
- which means we are in alternate screen modes or we have raw screen enabled - we should write to the screen passed by the user.
This way our commands or our writes will be done with the passed
TerminalOutput
.