Write colored text to memory.
Buffer is a platform independent abstraction for printing colored text to
an in memory buffer. When the buffer is printed using a
color information will be applied to the output device (a tty on Unix and a
console on Windows).
Buffer is typically created by calling the
method, which will take color preferences and the environment into
account. However, buffers can also be manually created using
console (on Windows).
Create a buffer that drops all color information.
Create a buffer that uses ANSI escape sequences.
Returns true if and only if this buffer is empty.
Returns the length of this buffer in bytes.
Clears this buffer.
pub fn into_inner(self) -> Vec<u8>[src]
Consume this buffer and return the underlying raw data.
On Windows, this unrecoverably drops all color information associated with the buffer.
Return the underlying data of the buffer.
pub fn as_mut_slice(&mut self) -> &mut [u8][src]
Return the underlying data of the buffer as a mutable slice.
fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize, Error>[src]
fn write_all_vectored(&mut self, bufs: &mut [IoSlice]) -> Result<(), Error>[src]
impl WriteColor for Buffer[src]
Auto Trait Implementations
impl RefUnwindSafe for Buffer
impl UnwindSafe for Buffer
type Error = Infallible
The type returned in the event of a conversion error.