Skip to main content

Capture

Enum Capture 

Source
#[non_exhaustive]
pub enum Capture { Discard, Whole { limit: usize, over: OverLimit, }, Tail { limit: usize, }, Lines { queue: LineQueue, line: usize, total: usize, over: OverLimit, }, }
Expand description

What a run keeps of one output stream of the child.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Discard

The stream goes to the null device, and the run keeps nothing.

§

Whole

The run keeps the stream’s first limit bytes. A stream longer than limit bytes is over its limit, and over says what the run does then.

Fields

§limit: usize

The most bytes that the run keeps.

§over: OverLimit

What the run does when the stream passes limit bytes.

§

Tail

The run reads the whole stream and keeps its last limit bytes.

Fields

§limit: usize

The most bytes that the run keeps.

§

Lines

The run splits the stream into lines on each newline and pushes each line, without its newline, to queue while the child runs. A last line with no newline is pushed when the stream ends. The run keeps no bytes in its Captured.

The first time one line passes line bytes or the stream passes total bytes, the stream is over its limit, and over says what the run does then. No line is pushed after that.

Each queue serves one run, which ends it when it returns.

Fields

§queue: LineQueue

The queue that the run pushes each line to, from line_queue.

§line: usize

The most bytes of one line, without its newline.

§total: usize

The most bytes of the whole stream, newlines included.

§over: OverLimit

What the run does when the stream passes a limit.

Trait Implementations§

Source§

impl Clone for Capture

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Capture

Source§

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

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

impl Default for Capture

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.