creche/lib.rs
1//! Configure, run, and monitor single child processes or entire pipelines of processes.
2//! [`ChildBuilder`] is the heart of this crate, it is responsible for
3//! starting child processes. The
4//! [`ioconfig`] module contains data structures that are used by
5//! `ChildBuilder` to create pipes and do various operations with file
6//! descriptors. The [`envconfig`] module has a builder for process
7//! environments - use it to set environment variables and control what a
8//! child process inherits from the parent process environment. The types
9//! in the [`pipeline`] module are conveniences for constructing and
10//! monitoring common case pipelines.
11
12#![allow(unused_imports)]
13pub const DEVNULL: &str = "/dev/null";
14
15mod creche;
16/// Types for manipulating the environment variables of a child process
17pub mod envconfig;
18/// Types used to configure child process file descriptors. The values
19/// obtained via the functions in this module are used with
20/// [`ChildBuilder::config_io()`].
21pub mod ioconfig;
22/// Helpers for composing child processes into a pipeline. Constructing
23/// pipelines manually is tedious and error prone.
24/// [`SimplePipelineBuilder`] will handle piping stdout -> stdin between
25/// processes and spawn everything in a simpler way than manually
26/// configuring pipes. See [`ioconfig::interprocess_pipe()`].
27pub mod pipeline;
28mod utils;
29
30// re-exports
31pub use creche::{Child, ChildBuilder, ChildHandle, SignalError};
32pub use nix::errno::Errno;
33pub use nix::sys::wait::WaitStatus;
34pub use pipeline::{PipelineChildren, SimplePipelineBuilder};
35pub use utils::Argument;