Skip to main content

Module process

Module process 

Source
Expand description

ProcessSpawner trait, Process handle trait, and the supporting value types every implementation produces.

The trait pair abstracts the executor’s view of the host OS’s process facilities so the production backend and the scriptable test-double mock can share one shape. The production backend StdProcessSpawner wraps tokio::process::Command; the mock lives alongside under [crate::mock_impl] but is gated to test builds only and is not part of the crate’s stable public surface. The trait associated types still carry tokio types (tokio::io::AsyncRead); the executor is tokio-bound by design and does not aim to be runtime-neutral.

Stream ownership is structural rather than convention. The Spawned value returned from ProcessSpawner::spawn carries the child’s stdout and stderr as fields; callers move them into reader tasks while keeping the Process value for waiting and signalling. This mirrors the take-once invariant of tokio::process::Child::stdout without exposing it as a runtime check.

Structs§

ProcessId
Numeric process identifier as reported by the host OS.
SpawnPlan
Description of one process the executor wants to spawn.
Spawned
Triple of values produced by ProcessSpawner::spawn.

Enums§

ProcessError
Failure modes shared by every ProcessSpawner and Process method.
Signal
Termination or cancellation signal the executor delivers to a child process during the cancellation flow (EXEC-013, EXEC-014).

Traits§

Process
Handle to one spawned child process.
ProcessSpawner
Trait for spawning child processes.

Type Aliases§

ExitStatus
Final state of a child process as reported by Process::wait.