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
Auto Trait Implementations
impl Freeze for StandardStream
impl RefUnwindSafe for StandardStream
impl Send for StandardStream
impl Sync for StandardStream
impl Unpin for StandardStream
impl UnsafeUnpin for StandardStream
impl UnwindSafe for StandardStream
Blanket Implementations
impl<T> Any for StandardStream
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for StandardStream
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for StandardStream
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for StandardStream
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for StandardStream
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for StandardStream
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for StandardStream
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>