Command: a process builder for child processes
Answer: Command is a process builder. It gives fine-grained control over how a new process is spawned. Output is the output of a finished process. Child is a representation of a running or exited child process. wait will return a process::ExitStatus.
Building and spawning
Command is a process builder, providing fine-grained control over how a new process should be spawned.
Output is what you get after a process has finished.
Child is a representation of a running or exited child process.
Stdio says what should happen to a standard I/O stream when you pass it to Command's stdin, stdout, or stderr methods.
ExitStatus describes the result of a process after it has terminated.
Output, pipes, and wait
In Rust by Example, Output is the output of a finished child, and Command is the builder.
Child also exposes stdin, stdout, and stderr so you can talk to the process through pipes.
Those handles have type Option, so you unwrap them when you know a pipe is present.
To wait until a Child finishes, call Child::wait, which yields a process::ExitStatus.
See also
Claims
- id: C1 claim: Command is a process builder for spawning a new process. source: S1 evidence: "process builder, providing fine-grained control"
- id: C2 claim: Output holds the output of a finished process. source: S1 evidence: "output of a finished process"
- id: C3 claim: ExitStatus describes the result after termination. source: S1 evidence: "after it has terminated"
- id: C4 claim: Command is a process builder. source: S2 evidence: "is a process builder"
- id: C5 claim: Child exposes stdin, stdout, and stderr as pipes. source: S2 evidence: "via pipes"
- id: C6 claim: Child::wait returns an ExitStatus. source: S2 evidence: "Child::wait"
Sources
- [S1] std::process. Rust Standard Library. https://doc.rust-lang.org/std/process/index.html . License: MIT OR Apache-2.0. Accessed 2026-11-23.
- [S2] Child processes. Rust By Example. https://doc.rust-lang.org/rust-by-example/std_misc/process.html . License: MIT OR Apache-2.0. Accessed 2026-11-23.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Rust Standard Library, std::process; Rust By Example, Child processes. MIT OR Apache-2.0 (https://raw.githubusercontent.com/rust-lang/rust/master/COPYRIGHT). Copyright the Rust Project Developers. MIT OR Apache-2.0 (https://raw.githubusercontent.com/rust-lang/rust-by-example/master/LICENSE-MIT). Copyright the Rust Project Developers. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Rust Standard Library, std::process; Rust By Example, Child processes. MIT OR Apache-2.0 (https://raw.githubusercontent.com/rust-lang/rust/master/COPYRIGHT). Copyright the Rust Project Developers. MIT OR Apache-2.0 (https://raw.githubusercontent.com/rust-lang/rust-by-example/master/LICENSE-MIT). Copyright the Rust Project Developers.
Cite this
iinventedlight. 2026. "Command: a process builder for child processes." iinventedlight Library, iil:note:c2yhs564, version of 2026-11-23. https://iinventedlight.com/library/notes/rust-command/. License: CC-BY-4.0.
@misc{iil_note_c2yhs564,
author = {{iinventedlight}},
title = {{Command: a process builder for child processes}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-23},
url = {https://iinventedlight.com/library/notes/rust-command/},
note = {Permanent ID iil:note:c2yhs564. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- rust-command.schema.json (schema; CC-BY-4.0)
- rust-command.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/rust-command.md.