apipe
A simple anonymous UNIX pipe type.
Usage
try_from(&str)
The probably easiest way to create a pipe is by parsing a command string:
use CommandPipe;
let mut pipe = try_from?;
let output = pipe.spawn_with_output?;
assert_eq!;
This requires the parser
feature to be enabled.
Pipe Command Objects
Create the individual Commands and then contruct a pipe from them:
use Command;
let mut pipe = parse_str?
| parse_str?;
// or:
let mut pipe = new.arg
| new.args;
let output = pipe.spawn_with_output?;
assert_eq!;
Command
s can also be constructed manually if you want:
let mut command = new.arg;
Builder
There is also a conventional builder syntax:
use CommandPipe;
let output = new
.add_command
.arg
.add_command
.args
.spawn_with_output?;
assert_eq!;