pub struct ScopedProcessHandle { /* private fields */ }
Expand description
A wrapper around ProcessHandle
that kills the associated child process, when the last instance of the handle is dropped.
There is no guarantee that the process will be killed immediately.
The handle can be created also by calling ProcessManagerHandle::spawn_with_scoped_handle
.
Implementations§
Source§impl ScopedProcessHandle
impl ScopedProcessHandle
Sourcepub fn new(handle: ProcessHandle) -> Self
pub fn new(handle: ProcessHandle) -> Self
Creates a new ScopedProcessHandle
from given process handle.
Sourcepub async fn send_message<M>(&self, message: M) -> Result<(), WriteMessageError>
pub async fn send_message<M>(&self, message: M) -> Result<(), WriteMessageError>
See ProcessManagerHandle::send_message
docs.
Sourcepub async fn subscribe_message_stream(
&self,
) -> Result<impl Stream<Item = Result<Message, ReceiveMessageError>>, ReadMessageError>
pub async fn subscribe_message_stream( &self, ) -> Result<impl Stream<Item = Result<Message, ReceiveMessageError>>, ReadMessageError>
Sourcepub async fn get_logs_stdout(
&self,
query: LogsQuery,
) -> Result<Vec<String>, GetLogsError>
pub async fn get_logs_stdout( &self, query: LogsQuery, ) -> Result<Vec<String>, GetLogsError>
See ProcessManagerHandle::get_logs_stdout
docs.
Sourcepub async fn get_logs_stderr(
&self,
query: LogsQuery,
) -> Result<Vec<String>, GetLogsError>
pub async fn get_logs_stderr( &self, query: LogsQuery, ) -> Result<Vec<String>, GetLogsError>
See ProcessManagerHandle::get_logs_stderr
docs.
Sourcepub async fn get_process_info(&self) -> Result<ProcessInfo, GetProcessInfoError>
pub async fn get_process_info(&self) -> Result<ProcessInfo, GetProcessInfoError>
See ProcessManagerHandle::get_process_info
docs.
Sourcepub fn wait(
&self,
poll_interval: Duration,
) -> JoinHandle<Result<ProcessInfo, GetProcessInfoError>>
pub fn wait( &self, poll_interval: Duration, ) -> JoinHandle<Result<ProcessInfo, GetProcessInfoError>>
See ProcessManagerHandle::wait
docs.
Sourcepub async fn kill(&self) -> Result<(), KillProcessError>
pub async fn kill(&self) -> Result<(), KillProcessError>
See ProcessManagerHandle::kill
docs.
Trait Implementations§
Source§impl Clone for ScopedProcessHandle
impl Clone for ScopedProcessHandle
Source§fn clone(&self) -> ScopedProcessHandle
fn clone(&self) -> ScopedProcessHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ScopedProcessHandle
impl Debug for ScopedProcessHandle
Source§impl Drop for ScopedProcessHandle
impl Drop for ScopedProcessHandle
Source§impl From<ProcessHandle> for ScopedProcessHandle
impl From<ProcessHandle> for ScopedProcessHandle
Source§fn from(handle: ProcessHandle) -> Self
fn from(handle: ProcessHandle) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ScopedProcessHandle
impl RefUnwindSafe for ScopedProcessHandle
impl Send for ScopedProcessHandle
impl Sync for ScopedProcessHandle
impl Unpin for ScopedProcessHandle
impl UnwindSafe for ScopedProcessHandle
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