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: W1Writer for captured stdout (typically the parent process’s stdout).
stderr: W2Writer for captured stderr (typically the parent process’s stderr).
Trait Implementations§
Source§impl<W1: Write, W2: Write> TestOutputSink for StreamingSink<W1, W2>
impl<W1: Write, W2: Write> TestOutputSink for StreamingSink<W1, W2>
Source§fn write_stdout(
&mut self,
executable: &TestExecutable,
bytes: &[u8],
) -> Result<()>
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<()>
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<()>
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 moreAuto Trait Implementations§
impl<W1, W2> Freeze for StreamingSink<W1, W2>
impl<W1, W2> RefUnwindSafe for StreamingSink<W1, W2>where
W1: RefUnwindSafe,
W2: RefUnwindSafe,
impl<W1, W2> Send for StreamingSink<W1, W2>
impl<W1, W2> Sync for StreamingSink<W1, W2>
impl<W1, W2> Unpin for StreamingSink<W1, W2>
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> 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