Struct StandardStream

struct StandardStream { ... }

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) -> StandardStream

Create a new StandardStream with 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 WriteColor trait.

fn stderr(choice: ColorChoice) -> StandardStream

Create a new StandardStream with 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 WriteColor trait.

fn lock(self: &Self) -> StandardStreamLock<'_>

Lock the underlying writer.

The lock guard returned also satisfies io::Write and WriteColor.

This method is not reentrant. It may panic if lock is called while a StandardStreamLock is still alive.

impl Debug for StandardStream

fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result

impl Freeze for StandardStream

impl RefUnwindSafe for StandardStream

impl Send for StandardStream

impl Sync for StandardStream

impl Unpin for StandardStream

impl UnwindSafe for StandardStream

impl Write for StandardStream

fn write(self: &mut Self, b: &[u8]) -> io::Result<usize>
fn flush(self: &mut Self) -> io::Result<()>

impl WriteColor for StandardStream

fn supports_color(self: &Self) -> bool
fn supports_hyperlinks(self: &Self) -> bool
fn set_color(self: &mut Self, spec: &ColorSpec) -> io::Result<()>
fn set_hyperlink(self: &mut Self, link: &HyperlinkSpec<'_>) -> io::Result<()>
fn reset(self: &mut Self) -> io::Result<()>
fn is_synchronous(self: &Self) -> bool

impl<T> Any for StandardStream

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for StandardStream

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for StandardStream

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for StandardStream

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for StandardStream

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for StandardStream

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for StandardStream

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>