pub struct StdoutCapture { /* private fields */ }
Expand description

StdoutCapture holds the standard output from multiple processes.

The most common pattern of usage is to capture together the output from a starting process and all sub-processes. E.g. Hide output of sub-processes during testing.

Implementations§

source§

impl StdoutCapture

source

pub fn new(echo: bool) -> Self

source

pub fn only_reference(&self) -> bool

Returns true if this is the only reference to the outputs.

source

pub fn next(&self) -> Self

Returns a clone of StdoutCapture pointing to the next stream

source

pub fn is_empty(&self) -> bool

Returns true if all streams are empty

source

pub fn content(&self) -> String

Returns stream’s content

source

pub fn push_str(&self, content: &str)

Add string to end of the stream

Trait Implementations§

source§

impl Clone for StdoutCapture

source§

fn clone(&self) -> StdoutCapture

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StdoutCapture

source§

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

Formats the value using the given formatter. Read more
source§

impl Display for StdoutCapture

source§

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

Formats the value using the given formatter. Read more
source§

impl PartialEq<StdoutCapture> for StdoutCapture

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl WasiFile for StdoutCapture

source§

fn as_any(&self) -> &dyn Any

source§

fn datasync<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn sync<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn get_filetype<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FileType, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn get_fdflags<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<FdFlags, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn set_fdflags<'life0, 'async_trait>( &'life0 mut self, _fdflags: FdFlags ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn get_filestat<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Filestat, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn set_filestat_size<'life0, 'async_trait>( &'life0 self, _size: u64 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn advise<'life0, 'async_trait>( &'life0 self, _offset: u64, _len: u64, _advice: Advice ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn allocate<'life0, 'async_trait>( &'life0 self, _offset: u64, _len: u64 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn read_vectored<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _bufs: &'life1 mut [IoSliceMut<'a>] ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn read_vectored_at<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _bufs: &'life1 mut [IoSliceMut<'a>], _offset: u64 ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn write_vectored<'a, 'life0, 'life1, 'async_trait>( &'life0 self, bufs: &'life1 [IoSlice<'a>] ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn write_vectored_at<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _bufs: &'life1 [IoSlice<'a>], _offset: u64 ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn seek<'life0, 'async_trait>( &'life0 self, _pos: SeekFrom ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn peek<'life0, 'life1, 'async_trait>( &'life0 self, _buf: &'life1 mut [u8] ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn set_times<'life0, 'async_trait>( &'life0 self, _atime: Option<SystemTimeSpec>, _mtime: Option<SystemTimeSpec> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn num_ready_bytes(&self) -> Result<u64, Error>

source§

fn isatty(&self) -> bool

source§

fn readable<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn writable<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn sock_accept<'life0, 'async_trait>( &'life0 self, _fdflags: FdFlags ) -> Pin<Box<dyn Future<Output = Result<Box<dyn WasiFile>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn pollable(&self) -> Option<BorrowedFd<'_>>

source§

fn sock_recv<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _ri_data: &'life1 mut [IoSliceMut<'a>], _ri_flags: RiFlags ) -> Pin<Box<dyn Future<Output = Result<(u64, RoFlags), Error>> + Send + 'async_trait, Global>>where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

source§

fn sock_send<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _si_data: &'life1 [IoSlice<'a>], _si_flags: SiFlags ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait, Global>>where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

source§

fn sock_shutdown<'life0, 'async_trait>( &'life0 self, _how: SdFlags ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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> Pointee for T

§

type Pointer = u32

source§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_> ) -> Result<(), Error>

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more