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.
It is intended for a BufferWriter to be used from multiple threads
simultaneously, but note that buffer printing is serialized.
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.
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.
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
Mutably borrows from an owned value. Read more