Function rustix::io::stdout

source ·
pub const fn stdout() -> BorrowedFd<'static>
Expand description

STDOUT_FILENO—Standard output, borrowed.

In std-using configurations, this is a safe function, because the standard library already assumes that the stdout file descriptor is always valid. In no_std configurations, it is unsafe.

Warning

This function allows reading directly from stdout without coordinating with the buffering performed by std::io::Stdout, so it could cause corrupted input.

References