pub struct BufferWriter { /* private fields */ }
Expand description
Writes colored buffers to stdout or stderr.
Writable buffers can be obtained by calling buffer
on a BufferWriter
.
This writer works with terminals that support ANSI escape sequences or with a Windows console.
It is intended for a BufferWriter
to be put in an Arc
and written to
from multiple threads simultaneously.
Implementations§
Source§impl BufferWriter
impl BufferWriter
Sourcepub fn stdout(choice: ColorChoice) -> BufferWriter
pub fn stdout(choice: ColorChoice) -> BufferWriter
Create a new BufferWriter
that writes to stdout with the given
color preferences.
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 to the buffers themselves.
Sourcepub fn stderr(choice: ColorChoice) -> BufferWriter
pub fn stderr(choice: ColorChoice) -> BufferWriter
Create a new BufferWriter
that writes to stderr with the given
color preferences.
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 to the buffers themselves.
Sourcepub fn separator(&mut self, sep: Option<Vec<u8>>)
pub fn separator(&mut self, sep: Option<Vec<u8>>)
If set, the separator given is printed between buffers. By default, no separator is printed.
The default value is None
.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BufferWriter
impl RefUnwindSafe for BufferWriter
impl Send for BufferWriter
impl Sync for BufferWriter
impl Unpin for BufferWriter
impl UnwindSafe for BufferWriter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more