Struct StandardStream
pub struct StandardStream { /* private fields */ }
Satisfies io::Write and WriteColor, and supports optional coloring
to either of the standard output streams, stdout and stderr.
Implementations
impl StandardStream
fn stdout(choice: ColorChoice) -> StandardStreamCreate a new
StandardStreamwith the given color preferences that writes to standard output.On Windows, if coloring is desired and a Windows console could not be found, then ANSI escape sequences are used instead.
The specific color/style settings can be configured when writing via the
WriteColortrait.fn stderr(choice: ColorChoice) -> StandardStreamCreate a new
StandardStreamwith the given color preferences that writes to standard error.On Windows, if coloring is desired and a Windows console could not be found, then ANSI escape sequences are used instead.
The specific color/style settings can be configured when writing via the
WriteColortrait.fn lock(&self) -> StandardStreamLock<'_>Lock the underlying writer.
The lock guard returned also satisfies
io::WriteandWriteColor.This method is not reentrant. It may panic if
lockis called while aStandardStreamLockis still alive.
Trait Implementations
impl Debug for StandardStream
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Write for StandardStream
fn write(&mut self, b: &[u8]) -> Result<usize>fn flush(&mut self) -> Result<()>
impl WriteColor for StandardStream
fn supports_color(&self) -> boolfn supports_hyperlinks(&self) -> boolfn set_color(&mut self, spec: &ColorSpec) -> Result<()>fn set_hyperlink(&mut self, link: &HyperlinkSpec<'_>) -> Result<()>fn reset(&mut self) -> Result<()>fn is_synchronous(&self) -> bool