Struct Child

Source
pub struct Child<Stream: AsyncStream, T: Object> { /* private fields */ }
Expand description

A subprocess.

Implementations§

Source§

impl<Stream: AsyncStream, T: Object> Child<Stream, T>

Source

pub fn get_kill_handle(&self) -> KillHandle

Get a handle for process termination.

Source

pub fn id(&self) -> pid_t

Get ID of the process.

Source

pub async fn join(self) -> Result<T>

Wait for the process to finish and obtain the value it returns.

An error is returned if the process panics or is terminated. An error is also delivered if it exits via std::process::exit or alike instead of returning a value, unless the return type is (). In that case, Ok(()) is returned.

Trait Implementations§

Source§

impl<Stream: AsyncStream + Debug, T: Object> Debug for Child<Stream, T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Stream, T> Freeze for Child<Stream, T>
where Stream: Freeze,

§

impl<Stream, T> RefUnwindSafe for Child<Stream, T>
where Stream: RefUnwindSafe,

§

impl<Stream, T> Send for Child<Stream, T>
where Stream: Send,

§

impl<Stream, T> Sync for Child<Stream, T>
where Stream: Sync,

§

impl<Stream, T> Unpin for Child<Stream, T>
where Stream: Unpin,

§

impl<Stream, T> UnwindSafe for Child<Stream, T>
where Stream: UnwindSafe,

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

Source§

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