Function std::io::stderr_locked
pub fn stderr_locked() -> StderrLock<'static>ⓘNotable traits for StderrLock<'_>impl Write for StderrLock<'_>
Constructs a new locked handle to the standard error of the current process.
This handle is not buffered.
Note: Windows Portability Consideration
When operating in a console, the Windows implementation of this stream does not support non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return an error.
Example
#![feature(stdio_locked)] use std::io::{self, Write}; fn main() -> io::Result<()> { let mut handle = io::stderr_locked(); handle.write_all(b"hello world")?; Ok(()) }
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/io/fn.stderr_locked.html