Struct strip_ansi_escapes::Writer[][src]

pub struct Writer<W> where
    W: Write
{ /* fields omitted */ }

Writer wraps an underlying type that implements Write, stripping ANSI escape sequences from bytes written to it before passing them to the underlying writer.

Example

use std::io::{self, Write};
use strip_ansi_escapes::Writer;

let bytes_with_colors = b"\x1b[32mfoo\x1b[m bar";
let mut writer = Writer::new(io::stdout());
// Only `foo bar` will be written to stdout
writer.write_all(bytes_with_colors)?;

Implementations

impl<W> Writer<W> where
    W: Write
[src]

pub fn new(inner: W) -> Writer<W>

Notable traits for Writer<W>

impl<W> Write for Writer<W> where
    W: Write
[src]

Create a new Writer that writes to inner.

pub fn into_inner(self) -> Result<W, IntoInnerError<LineWriter<W>>>[src]

Unwraps this Writer, returning the underlying writer.

The internal buffer is written out before returning the writer, which may produce an IntoInnerError.

Trait Implementations

impl<W> Write for Writer<W> where
    W: Write
[src]

Auto Trait Implementations

impl<W> !RefUnwindSafe for Writer<W>

impl<W> Send for Writer<W> where
    W: Send

impl<W> Sync for Writer<W> where
    W: Sync

impl<W> Unpin for Writer<W> where
    W: Unpin

impl<W> !UnwindSafe for Writer<W>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.