1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! Production-grade subprocess runner with typed errors, retry, and timeout.
//!
//! `procpilot` provides one entry point — the [`Cmd`] builder — covering every
//! practical subprocess configuration. Errors are typed: [`RunError`]
//! distinguishes spawn failure, non-zero exit, and timeout, each carrying
//! the last 128 KiB of stdout/stderr for diagnosis.
//!
//! # Quick start
//!
//! ```no_run
//! use std::time::Duration;
//! use procpilot::{Cmd, RunError};
//!
//! let output = Cmd::new("git")
//! .args(["show", "maybe-missing-ref"])
//! .timeout(Duration::from_secs(30))
//! .run();
//!
//! match output {
//! Ok(o) => println!("{}", o.stdout_lossy()),
//! Err(RunError::NonZeroExit { .. }) => { /* ref not found */ }
//! Err(e) => return Err(e.into()),
//! }
//! # Ok::<(), anyhow::Error>(())
//! ```
//!
//! # Features
//!
//! - **Typed errors**: [`RunError`] variants for spawn / non-zero / timeout,
//! with shell-quoted command display (secret-redacted via [`Cmd::secret`]).
//! - **Stdin**: [`Cmd::stdin`] accepts owned bytes (reusable across retries)
//! or a boxed `Read` (one-shot).
//! - **Stderr routing**: [`Redirection`] covers capture, inherit, null, and
//! file redirection.
//! - **Timeout + deadline**: [`Cmd::timeout`] for per-attempt, [`Cmd::deadline`]
//! for overall wall-clock budget across retries.
//! - **Retry with exponential backoff**: [`Cmd::retry`] / [`Cmd::retry_when`].
//! - **Escape hatches**: [`Cmd::before_spawn`] for pre-spawn hooks,
//! [`Cmd::to_command`] to drop to raw `std::process::Command`.
//!
//! Release history: [CHANGELOG.md](https://github.com/michaeldhopkins/procpilot/blob/main/CHANGELOG.md).
pub use ;
pub use CmdDisplay;
pub use ;
pub use Redirection;
pub use ;
pub use ;
pub use StdinData;