Skip to main content

ChildFinished

Struct ChildFinished 

Source
pub struct ChildFinished { /* private fields */ }
Expand description

How a run’s child ended and what the run kept of its output.

Implementations§

Source§

impl ChildFinished

Source

pub const fn outcome(&self) -> Outcome

Returns how the child ended.

Source

pub const fn status(&self) -> Option<Status>

Returns the child’s own status as the run reaped it, or None when the run started no child because its cancel was already cancelled.

The status tells how the child ended even when the run stopped it. A run whose cancel stopped a child that SIGINT ended gives Outcome::Stopped(StopReason::Cancelled) and the status Status::Signal(2), whose Status::shell_code is 130. A child that handles the signal and exits with a code of its own gives that code.

Source

pub const fn survivors(&self) -> bool

Returns true when RunOptions::report_survivors asked, the child ended by itself, and another process in its group still ran then. A run that stopped the child gives false.

A process that left the group, such as one that called setsid, is not in it, so it does not count.

Source

pub const fn was_overdue(&self) -> bool

Returns true when the report of RunOptions::overdue ran, so the child was still running at the overdue time. The outcome tells how the child ended after that.

Source

pub const fn stdout(&self) -> &Captured

Returns what the run kept of standard output.

Source

pub const fn stderr(&self) -> &Captured

Returns what the run kept of standard error.

Source

pub fn into_output(self) -> (Captured, Captured)

Returns what the run kept of standard output and standard error.

Source

pub const fn first_stdout(&self) -> Option<Duration>

Returns the time from the child’s start to the first byte of its standard output, or None when it printed none, when the run inherited standard output, or when the run discarded it and had no copy function.

Trait Implementations§

Source§

impl Clone for ChildFinished

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 ChildFinished

Source§

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

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

impl Eq for ChildFinished

Source§

impl PartialEq for ChildFinished

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ChildFinished

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.