Skip to main content

harn_hostlib/process/
mod.rs

1//! Process abstraction used by the deterministic process tools.
2//!
3//! Production code spawns through [`spawn_process`], which dispatches to
4//! the [`ProcessSpawner`] currently installed via
5//! [`install_spawner`]. The default spawner ([`real::default_spawner`])
6//! goes through `harn_vm::process_sandbox`. Tests install
7//! [`mock::MockSpawner`] to drive process behaviour deterministically.
8
9pub mod handle;
10pub mod mock;
11pub mod real;
12#[cfg(target_os = "windows")]
13mod windows;
14
15pub use handle::{
16    current_spawner, install_spawner, spawn_process, EnvMode, ExitStatus, OutputCapture,
17    ProcessCleanupChild, ProcessCleanupReport, ProcessError, ProcessHandle, ProcessKiller,
18    ProcessSpawner, SpawnSpec, SpawnerGuard, WaitOutcome,
19};
20pub use mock::{MockHandleController, MockProcess, MockProcessConfig, MockSpawner};
21pub use real::default_spawner;
22#[cfg(unix)]
23pub use real::replace_current_process;
24#[cfg(target_os = "windows")]
25pub use windows::KillOnCloseJob;