heim_process/os/unix/mod.rs
1//! Unix-specific extensions.
2
3use heim_common::prelude::BoxFuture;
4
5use crate::ProcessResult;
6
7mod signal;
8
9pub use self::signal::Signal;
10
11/// Unix-specific extension to [Process].
12///
13/// [Process]: ../../struct.Process.html
14pub trait ProcessExt {
15 /// Send the signal to process.
16 ///
17 /// Since `-> impl Trait` is not allowed yet in the trait methods,
18 /// this method returns boxed `Future`. This behavior will change later.
19 fn signal(&self, signal: Signal) -> BoxFuture<ProcessResult<()>>;
20}
21
22#[cfg(unix)]
23impl ProcessExt for crate::Process {
24 fn signal(&self, signal: Signal) -> BoxFuture<ProcessResult<()>> {
25 self.as_ref().signal(signal)
26 }
27}