pub struct ProcessHandle { /* private fields */ }Implementations§
Source§impl ProcessHandle
impl ProcessHandle
pub fn spawn(name: impl Into<Cow<'static, str>>, cmd: Command) -> Result<Self>
pub fn new_from_child_with_piped_io( name: impl Into<Cow<'static, str>>, child: Child, ) -> Self
pub fn new_from_child_with_piped_io_and_capacity( name: impl Into<Cow<'static, str>>, child: Child, stdout_channel_capacity: usize, stderr_channel_capacity: usize, ) -> Self
pub fn id(&self) -> Option<u32>
pub fn is_running(&mut self) -> IsRunning
pub fn stdout(&self) -> &OutputStream
pub fn stderr(&self) -> &OutputStream
pub async fn wait(&mut self) -> Result<ExitStatus>
pub async fn wait_with_output( &mut self, ) -> Result<(ExitStatus, Vec<String>, Vec<String>), WaitError>
pub fn terminate_on_drop( self, graceful_termination_timeout: Duration, forceful_termination_timeout: Duration, ) -> TerminateOnDrop
Sourcepub async fn send_interrupt_signal(&mut self) -> Result<(), Error>
pub async fn send_interrupt_signal(&mut self) -> Result<(), Error>
Manually sed a SIGINT on unix or equivalent on Windows to this process.
Prefer to call terminate instead, if you want to make sure this process is terminated.
Sourcepub async fn send_terminate_signal(&mut self) -> Result<(), Error>
pub async fn send_terminate_signal(&mut self) -> Result<(), Error>
Manually sed a SIGTERM on unix or equivalent on Windows to this process.
Prefer to call terminate instead, if you want to make sure this process is terminated.
Sourcepub async fn terminate(
&mut self,
interrupt_timeout: Duration,
terminate_timeout: Duration,
) -> Result<ExitStatus, TerminationError>
pub async fn terminate( &mut self, interrupt_timeout: Duration, terminate_timeout: Duration, ) -> Result<ExitStatus, TerminationError>
Terminates this process by sending a SIGINT, SIGTERM or even a SIGKILL if the process
doesn’t run to completion after receiving any of the first two signals.
Recommendation: Use timeout!
Sourcepub fn into_inner(self) -> (Child, OutputStream, OutputStream)
pub fn into_inner(self) -> (Child, OutputStream, OutputStream)
Consumes this handle to provide the wrapped tokio::process::Child instance as well as the
stdout and stderr output streams.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProcessHandle
impl !RefUnwindSafe for ProcessHandle
impl Send for ProcessHandle
impl Sync for ProcessHandle
impl Unpin for ProcessHandle
impl !UnwindSafe for ProcessHandle
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