Skip to main content

StreamingSink

Struct StreamingSink 

Source
pub struct StreamingSink<W1, W2> {
    pub stdout: W1,
    pub stderr: W2,
}
Expand description

A TestOutputSink that streams bytes to the supplied stdout/stderr writers. Each non-empty write prepends a header so the user can tell which executable is speaking.

Fields§

§stdout: W1

Writer for captured stdout (typically the parent process’s stdout).

§stderr: W2

Writer for captured stderr (typically the parent process’s stderr).

Trait Implementations§

Source§

impl<W1: Write, W2: Write> TestOutputSink for StreamingSink<W1, W2>

Source§

fn write_stdout( &mut self, executable: &TestExecutable, bytes: &[u8], ) -> Result<()>

Called zero or more times per executable with stdout bytes. Read more
Source§

fn write_stderr( &mut self, executable: &TestExecutable, bytes: &[u8], ) -> Result<()>

Called zero or more times per executable with stderr bytes. Read more
Source§

fn test_finished(&mut self, result: &TestRunResult) -> Result<()>

Called exactly once per executable, immediately after it exits and before the next executable starts. Streaming sinks render the per-test result line here so multi-test runs report progress the way cargo test does. The default implementation does nothing. Read more

Auto Trait Implementations§

§

impl<W1, W2> Freeze for StreamingSink<W1, W2>
where W1: Freeze, W2: Freeze,

§

impl<W1, W2> RefUnwindSafe for StreamingSink<W1, W2>

§

impl<W1, W2> Send for StreamingSink<W1, W2>
where W1: Send, W2: Send,

§

impl<W1, W2> Sync for StreamingSink<W1, W2>
where W1: Sync, W2: Sync,

§

impl<W1, W2> Unpin for StreamingSink<W1, W2>
where W1: Unpin, W2: Unpin,

§

impl<W1, W2> UnsafeUnpin for StreamingSink<W1, W2>
where W1: UnsafeUnpin, W2: UnsafeUnpin,

§

impl<W1, W2> UnwindSafe for StreamingSink<W1, W2>
where W1: UnwindSafe, W2: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V