Function conch_runtime::spawn::pipeline [] [src]

pub fn pipeline<I, E>(
    invert_last_status: bool,
    commands: I,
    env: &E
) -> Result<Pipeline<I::Item, E>> where
    I: IntoIterator,
    I::Item: Spawn<E>,
    E: FileDescEnvironment + SubEnvironment,
    E::FileHandle: From<FileDesc> + Clone

Spawns a pipeline of commands.

The standard output of the previous command will be piped as standard input to the next. The very first and last commands will inherit standard intput and output from the environment, respectively.

If invert_last_status is set to false, the pipeline will fully resolve to the last command's exit status. Otherwise, EXIT_ERROR will be returned if the last command succeeds, and EXIT_SUCCESS will be returned otherwise.

Panics

Panics if there aren't at least two or more commands in the pipeline.