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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! Subprocess execution with explicit I/O modes, process-group isolation, and timeouts.
//!
//! This crate provides functionality to execute external processes with:
//! - Timeout support with configurable grace period
//! - SIGTERM → SIGKILL escalation for graceful shutdown
//! - Process group isolation to ensure child processes are properly terminated
//! - Explicit captured, observed, and inherited stdio modes
//! - Environment variable control
//! - Working directory configuration
//!
//! # I/O modes
//!
//! `ProcessIo::Captured` captures stdout and stderr separately through pipes.
//! It is deterministic for non-interactive commands, but it is not a terminal
//! and cannot guarantee exact ordering between stdout and stderr.
//!
//! `ProcessIo::Observed` also uses separate pipes and supports live raw-byte or
//! line callbacks with optional capture. Line observers split deterministically
//! on `\n`, `\r`, and `\r\n`; invalid UTF-8 is reported lossily.
//!
//! `ProcessIo::Inherited` gives the child the parent stdio handles. This is the
//! right mode for normal terminal commands, but it does not provide structured
//! output capture.
//!
//! # Example
//!
//! ```no_run
//! use rskit_process::{ProcessConfig, ProcessSpec, run_with_cancel};
//! use std::time::Duration;
//! use tokio_util::sync::CancellationToken;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let spec = ProcessSpec::new("echo")
//! .arg("hello")
//! .arg("world");
//!
//! let config = ProcessConfig::default().with_timeout(Some(Duration::from_secs(30)));
//!
//! let result = run_with_cancel(&spec, &config, CancellationToken::new()).await?;
//! println!("stdout: {}", result.stdout);
//! println!("exit code: {:?}", result.exit_code);
//! # Ok(())
//! # }
//! ```
pub use ;
pub use ;
pub use ;
pub use ProcessResult;
pub use ;
pub use run;
/// Re-export error types
pub use ;