GeezerVison is showing doc.rust-lang.org — StdoutLock in std::io - Rust Struct StdoutLock 1.0.0 · Source pub struct StdoutLock<'a> { /* private fields */ }
Expand descriptionA locked reference to the Stdout handle.
This handle implements the Write trait, and is constructed via
the Stdout::lock method. See its documentation for more.
By default, the handle is line-buffered when connected to a terminal, meaning
it flushes automatically when a newline (\n) is encountered. For immediate
output, you can manually call the flush method. When the handle goes out
of scope, the buffer is automatically flushed.
§Note: Windows Portability Considerations
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.
In a process with a detached console, such as one using
#![windows_subsystem = "windows"], or in a child process spawned from such a process,
the contained handle will be null. In such cases, the standard library’s Read and
Write will do nothing and silently succeed. All other I/O operations, via the
standard library or via raw Windows API calls, will fail.
Trait Implementations§1.63.0 · Source§Available on Hermit or Motor OS or Trusty or Unix or WASI only. 1.63.0 · Source§Available on Windows only. 1.35.0 · Source§Available on Hermit or Motor OS or Trusty or Unix or WASI only. 1.35.0 · Source§Available on Windows only.
Formats the value using the given formatter. Read more
Returns true if the descriptor/handle refers to a terminal/tty. Read more
🔬This is a nightly-only experimental API. (stdio_swap #150667) Redirects the stdio file descriptor to point to the file description underpinning fd. Read more
🔬This is a nightly-only experimental API. (stdio_swap #150667) Redirects the stdio file descriptor to the null device ( /dev/null)
and returns a new OwnedFd backed by the previous file description. Read more
🔬This is a nightly-only experimental API. (stdio_swap #150667) Redirects the stdio file descriptor and returns a new OwnedFd
backed by the previous file description. Read more
🔬This is a nightly-only experimental API. (stdio_swap #150667) Sets the stdio console handle to handle, or NULL if it is None.
The old handle, if any, will not be closed, i.e. it is leaked because
console handles are shared global resources. Read more
🔬This is a nightly-only experimental API. (stdio_swap #150667) Sets the stdio console handle to replace_with. The previous handle is returned, or
None if it was NULL. Read more
🔬This is a nightly-only experimental API. (stdio_swap #150667) Sets the stdio console handle to NULL and returns the old one Read more
Writes a buffer into this writer, returning how many bytes were written. Read more
🔬This is a nightly-only experimental API. (can_vector #69941)
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Attempts to write an entire buffer into this writer. Read more
🔬This is a nightly-only experimental API. (write_all_vectored #70436) Attempts to write multiple buffers into this writer. Read more
Writes a formatted string into this writer, returning any error
encountered. Read more
Creates a “by reference” adapter for this instance of Write. Read moreAuto Trait Implementations§Blanket Implementations§
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion. |