pub struct TestBuffers {
pub stdout: TestBuffer,
pub stderr: TestBuffer,
}
Expand description
Provides shared memory buffers (in the form of TestBuffer
s for stdout
and stderr that can be used with implementations of crate::ToolIO
to
test input and output behaviour at runtime.
Fields§
§stdout: TestBuffer
§stderr: TestBuffer
Implementations§
Source§impl TestBuffers
impl TestBuffers
Sourcepub fn into_stdio(self) -> (Vec<u8>, Vec<u8>)
pub fn into_stdio(self) -> (Vec<u8>, Vec<u8>)
Destroy self
and return the standard output and error buffers as byte
arrays.
Sourcepub fn into_strings(self) -> (String, String)
pub fn into_strings(self) -> (String, String)
Destroy self
and return the standard output and error buffers as strings.
Sourcepub fn into_stdout(self) -> Vec<u8> ⓘ
pub fn into_stdout(self) -> Vec<u8> ⓘ
Destroy self
and return the standard output buffer as a byte
array.
Sourcepub fn into_stdout_str(self) -> String
pub fn into_stdout_str(self) -> String
Destroy self
and return the standard output buffer as a string.
Sourcepub fn into_stderr(self) -> Vec<u8> ⓘ
pub fn into_stderr(self) -> Vec<u8> ⓘ
Destroy self
and return the standard error buffer as a byte
array.
Sourcepub fn into_stderr_str(self) -> String
pub fn into_stderr_str(self) -> String
Destroy self
and return the standard error buffer as a string.
Trait Implementations§
Source§impl Debug for TestBuffers
impl Debug for TestBuffers
Source§impl Default for TestBuffers
impl Default for TestBuffers
Source§fn default() -> TestBuffers
fn default() -> TestBuffers
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TestBuffers
impl !RefUnwindSafe for TestBuffers
impl !Send for TestBuffers
impl !Sync for TestBuffers
impl Unpin for TestBuffers
impl !UnwindSafe for TestBuffers
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