Function rustix::io::take_stdout

source ·
pub unsafe fn take_stdout() -> OwnedFd
Expand description

STDOUT_FILENO—Standard output, owned.

This is similar to stdout, however it returns an OwnedFd which closes standard output when it is dropped.

Safety

Safe std-using Rust code is permitted to assume that the stdout file descriptor is always valid. This function returns an OwnedFd which will close the stdout file descriptor when dropped.

Warning

This has the same hazards as stdout.

References