unix-exec-output-catcher 0.2.4

Library to run executables in a child process and catch STDOUT and STDERR output on UNIX-systems. std::process::Command is probably the better option. Use this source code as educational source how it could be done.
Documentation
Build #1980328 2025-04-10 20:43:21
# rustc version
rustc 1.88.0-nightly (934880f58 2025-04-09)# docs.rs version
docsrs 0.6.0 (ee9a3fe6 2025-03-28)# build log
[INFO] running `Command { std: "docker" "create" "-v" "/home/cratesfyi/workspace/builds/unix-exec-output-catcher-0.2.4/target:/opt/rustwide/target:rw,Z" "-v" "/home/cratesfyi/workspace/builds/unix-exec-output-catcher-0.2.4/source:/opt/rustwide/workdir:ro,Z" "-v" "/home/cratesfyi/workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/home/cratesfyi/workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "DOCS_RS=1" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "6442450944" "--cpus" "6" "--user" "1001:1001" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:b0b074c097205a61b89e8ad263052f976b2b332c4dc5f02aef1fe52501660d6e" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "rustdoc" "--lib" "-Zrustdoc-map" "--config" "build.rustdocflags=[\"--cfg\", \"docsrs\", \"-Z\", \"unstable-options\", \"--emit=invocation-specific\", \"--resource-suffix\", \"-20250409-1.88.0-nightly-934880f58\", \"--static-root-path\", \"/-/rustdoc.static/\", \"--cap-lints\", \"warn\", \"--extern-html-root-takes-precedence\"]" "--offline" "-Zunstable-options" "--config=doc.extern-map.registries.crates-io=\"https://docs.rs/{pkg_name}/{version}/x86_64-unknown-linux-gnu\"" "-Zrustdoc-scrape-examples" "-j6" "--target" "x86_64-unknown-linux-gnu", kill_on_drop: false }`
[INFO] [stdout] 5a74935e62da59d937dd9607b429717271a25e23f02db499f799e5cff90e8031
[INFO] [stderr] WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
[INFO] running `Command { std: "docker" "start" "-a" "5a74935e62da59d937dd9607b429717271a25e23f02db499f799e5cff90e8031", kill_on_drop: false }`
[INFO] [stderr] warning: Rustdoc did not scrape the following examples because they require dev-dependencies: minimal
[INFO] [stderr]     If you want Rustdoc to scrape these examples, then add `doc-scrape-examples = true`
[INFO] [stderr]     to the [[example]] target configuration of at least one example.
[INFO] [stderr] warning: target filter specified, but no targets matched; this is a no-op
[INFO] [stderr]  Documenting unix-exec-output-catcher v0.2.4 (/opt/rustwide/workdir)
[INFO] [stderr] warning: this URL is not a hyperlink
[INFO] [stderr]   --> src/exec.rs:59:14
[INFO] [stderr]    |
[INFO] [stderr] 59 | ///          https://unix.stackexchange.com/questions/315812/why-does-argv-include-the-program-name
[INFO] [stderr]    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stderr]    |
[INFO] [stderr]    = note: bare URLs are not automatically turned into clickable links
[INFO] [stderr]    = note: `#[warn(rustdoc::bare_urls)]` on by default
[INFO] [stderr] help: use an automatic link instead
[INFO] [stderr]    |
[INFO] [stderr] 59 | ///          <https://unix.stackexchange.com/questions/315812/why-does-argv-include-the-program-name>
[INFO] [stderr]    |              +                                                                                      +
[INFO] [stderr] 
[INFO] [stderr] warning: this URL is not a hyperlink
[INFO] [stderr]   --> src/lib.rs:35:13
[INFO] [stderr]    |
[INFO] [stderr] 35 |     /// See https://man7.org/linux/man-pages/man3/errno.3.html
[INFO] [stderr]    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stderr]    |
[INFO] [stderr]    = note: bare URLs are not automatically turned into clickable links
[INFO] [stderr] help: use an automatic link instead
[INFO] [stderr]    |
[INFO] [stderr] 35 |     /// See <https://man7.org/linux/man-pages/man3/errno.3.html>
[INFO] [stderr]    |             +                                                  +
[INFO] [stderr] 
[INFO] [stderr] warning: `unix-exec-output-catcher` (lib doc) generated 2 warnings (run `cargo fix --lib -p unix-exec-output-catcher` to apply 2 suggestions)
[INFO] [stderr]     Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.39s
[INFO] [stderr]    Generated /opt/rustwide/target/x86_64-unknown-linux-gnu/doc/unix_exec_output_catcher/index.html
[INFO] running `Command { std: "docker" "inspect" "5a74935e62da59d937dd9607b429717271a25e23f02db499f799e5cff90e8031", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "rm" "-f" "5a74935e62da59d937dd9607b429717271a25e23f02db499f799e5cff90e8031", kill_on_drop: false }`
[INFO] [stdout] 5a74935e62da59d937dd9607b429717271a25e23f02db499f799e5cff90e8031