Struct StripStream

pub struct StripStream<S>
where
    S: Write, { /* private fields */ }

Only pass printable data to the inner Write

Implementations

impl StripStream<Stderr>

fn lock(self) -> StripStream<StderrLock<'static>>

Get exclusive access to the StripStream

Why?

  • Faster performance when writing in a loop
  • Avoid other threads interleaving output with the current thread

impl StripStream<Stdout>

fn lock(self) -> StripStream<StdoutLock<'static>>

Get exclusive access to the StripStream

Why?

  • Faster performance when writing in a loop
  • Avoid other threads interleaving output with the current thread

impl<S> StripStream<S> where S: Write + IsTerminal,

fn is_terminal(&self) -> bool

Returns true if the descriptor/handle refers to a terminal/tty.

impl<S> StripStream<S> where S: Write,

fn new(raw: S) -> Self

Only pass printable data to the inner Write

fn into_inner(self) -> S

Get the wrapped std::io::Write

fn as_inner(&self) -> &S

Get the wrapped std::io::Write

Trait Implementations

impl<S> Debug for StripStream<S> where S: Write + Debug,

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<S> Write for StripStream<S> where S: Write + AsLockedWrite,

fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize>
fn flush(&mut self) -> Result<()>
fn write_all(&mut self, buf: &[u8]) -> Result<()>
fn write_fmt(&mut self, args: Arguments<'_>) -> Result<()>

Auto Trait Implementations

impl<S> Freeze for StripStream<S> where S: Freeze,

impl<S> RefUnwindSafe for StripStream<S> where S: RefUnwindSafe,

impl<S> Send for StripStream<S> where S: Send,

impl<S> Sync for StripStream<S> where S: Sync,

impl<S> Unpin for StripStream<S> where S: Unpin,

impl<S> UnsafeUnpin for StripStream<S> where S: UnsafeUnpin,

impl<S> UnwindSafe for StripStream<S> where S: UnwindSafe,

Blanket Implementations

impl<T> Any for StripStream<S> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for StripStream<S> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for StripStream<S> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for StripStream<S>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for StripStream<S> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for StripStream<S> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for StripStream<S> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>