pub struct OwnedProcess { /* private fields */ }Expand description
Owns both the child and the cancellation capability. Never put this in editor state: Drop may wait, so it belongs exclusively to a worker stack.
Implementations§
Source§impl OwnedProcess
impl OwnedProcess
pub fn spawn( command: &mut Command, token: &CancelToken, ) -> Result<Self, Failure>
pub fn take_stdin(&mut self) -> Option<ChildStdin>
pub fn take_stdout(&mut self) -> Option<ChildStdout>
pub fn take_stderr(&mut self) -> Option<ChildStderr>
pub fn terminate(&mut self) -> Result<(), Failure>
Sourcepub fn has_exited(&self) -> Result<bool, Failure>
pub fn has_exited(&self) -> Result<bool, Failure>
Observe without reaping: descendants may still hold pipes, and cancellation must retain its PID reservation until those descendants have been killed.
Sourcepub fn wait(&mut self) -> Result<ExitStatus, Failure>
pub fn wait(&mut self) -> Result<ExitStatus, Failure>
Wait with cancellation intact, then revoke before reaping. A callback detached from CancelToken can never signal a reused PID.
Trait Implementations§
Source§impl Drop for OwnedProcess
impl Drop for OwnedProcess
Auto Trait Implementations§
impl !RefUnwindSafe for OwnedProcess
impl !UnwindSafe for OwnedProcess
impl Freeze for OwnedProcess
impl Send for OwnedProcess
impl Sync for OwnedProcess
impl Unpin for OwnedProcess
impl UnsafeUnpin for OwnedProcess
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more