Skip to main content

PlatformStdChild

Struct PlatformStdChild 

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

A synchronously launched child whose exit is observed by polling.

Implementations§

Source§

impl PlatformStdChild

Source

pub fn from_std(child: Child, own_process_group: bool) -> Self

Adopt a standard child. own_process_group records whether it was launched as the leader of its own process group.

Source

pub fn from_exact_trace(child: TracedChild, own_process_group: bool) -> Self

Adopt an exact-trace child; its tracer remains the sole reaper.

Source

pub fn id(&self) -> u32

Operating-system process identifier of the direct child.

Source

pub fn is_exact_trace(&self) -> bool

Whether the child is reaped by an exact-trace tracer.

Source

pub fn std_child(&self) -> Option<&Child>

The standard child handle, for post-spawn containment such as Job Object assignment. None for exact-trace children.

Source

pub fn attach_job(&mut self, job: WindowsJobHandle)

Keep the per-spawn Job Object alive exactly as long as this child.

Source

pub fn try_wait_code(&mut self) -> Result<Option<i32>>

Non-blocking exit check. Ok(None) while the child is running.

Source

pub fn wait_code(&mut self) -> Result<i32>

Blocking wait for the exit code.

An exact-trace child is waited by polling its tracer’s published state. This parks the calling thread, so it must never run on an actor-runtime worker; the runtime observes exit with Self::try_wait_code instead.

Source

pub fn kill(&mut self) -> Result<()>

Hard-kill the direct child without reaping it.

Source

pub fn kill_group_or_child(&mut self) -> Result<()>

Hard-kill the child’s own process group when it leads one and the host can signal groups, otherwise the direct child. Never reaps.

Source

pub fn take_stdin(&mut self) -> Option<ChildStdin>

Source

pub fn take_stdout(&mut self) -> Option<ChildStdout>

Source

pub fn take_stderr(&mut self) -> Option<ChildStderr>

Source

pub fn prepare_capture( &mut self, cancellation: &CaptureCancellation, ) -> Result<PlatformCaptureReaders>

Take both piped output streams and make them cancellable through cancellation (see cancel_capture_reader). The caller keeps sole ownership of the cancellation state, so dropping its last reference is the reader-teardown signal it always was. A failure leaves no half-registered reader.

Source

pub fn discard_after_start_error(self)

Abandon a child whose launch failed after spawn: kill it and reap it off the calling thread, so the caller’s error path stays bounded.

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.