dtact_util/process/mod.rs
1//! Async child-process primitives.
2//!
3//! Two backends, selected the same way as [`crate::io`]/[`crate::fs`]:
4//! - `native` (default): synchronous spawn (matches `tokio::process`'s
5//! own choice), `wait`/stdio I/O dispatched to a dedicated blocking-
6//! thread pool, completion signaled via
7//! [`crate::lockfree::OnceSlot`] — no `Mutex`-guarded completion state.
8//! Child handles are never shared: `wait`/`wait_with_output` consume
9//! `self` outright, and stdio handles are exclusively owned by whoever
10//! holds them. See `native`'s module doc for the full rationale.
11//! - `tokio` (when `native` is off): a thin wrapper over
12//! `tokio::process`.
13
14#[cfg(feature = "native")]
15mod native;
16#[cfg(feature = "native")]
17pub use native::*;
18
19// NOTE: named `tokio_backend`, not `tokio` — see `io::mod`'s doc for why a
20// local module literally named `tokio` shadows the extern crate.
21#[cfg(all(feature = "tokio", not(feature = "native")))]
22mod tokio_backend;
23#[cfg(all(feature = "tokio", not(feature = "native")))]
24pub use tokio_backend::*;