Expand description
process.rs — OS layer: spawn, capped IO drain, process-tree kill.
Structs§
- RawResult
- Result of a successful (possibly timed-out) execution.
Functions§
- drain_
with_ cap - Drain a reader into Bytes, stopping storage (but continuing to drain) once
capis reached. Sets truncated=true if the stream exceeded the cap. - kill_
tree - Kill the whole process group (Unix). Best-effort on Windows (post-v1: job object).
M-5: guard against pid 0/None (would signal the caller’s own group if the child
already exited and
id()returned None). - spawn
- Spawn the child in its own process group (Unix) with given env/cwd/args.
kill_on_drop(true)is a belt-and-suspenders guard so an accidentally-dropped Child never leaks a process (C-1 defense in depth).