Skip to main content

Module pio

Module pio 

Source
Available on crate feature process only.
Expand description

Utility to configure IO with child process.

The cu::pio::* functions can be used as arguments into the stdin, stdout and stderr functions of the Command builder to configure how you want to interact with the child process’s IO.

An input config can only be passed into stdin, whereas an output config can be used both for stdout and stderr. null and inherit can be used both as input and output.

§Available configurations

§Presets

Presets may apply more than just IO configuration, such as adding additional arguments or environments.

Modules§

config
internal task types used in trait implementations
output
internal output types used in trait implementations
task
internal task types used in trait implementations

Structs§

CoLines
Output of co_lines, an ansynchronous iterator that can reads the output line-by-line.
Lines
Output of lines, a synchronous iterator that can reads the output line-by-line.
Pipe
The output of pipe. Can be piped into another command’s stdin.

Traits§

ChildInConfig
Configuration for process input to be used with Command::stdin
ChildInTask
Task created by ChildInConfig
ChildOutConfig
Configuration for process output to be used with Command::stdout and Command::stderr
ChildOutTask
Task created by ChildOutConfig

Functions§

buffer
Buffer the output as a Vec<u8>
cargojson and print
Display progress of cargo task with a progress bar, and emitting status messages and diagnostic messages using this crate’s printing utilities.
co_lines
Create reader to access output line-by-line.
inherit
Inherit the parent’s stdin, stdout, or stderr.
lines
Create reader to access output line-by-line.
null
Direct the stream to null (i.e. ignore it)
pipe
Pipe the child’s output into another command’s stdin.
spinnerprint
Display child process’s status as a progress bar spinner.
string
Buffer the output as a String. Will error if the output is not valid UTF-8.
write
Write an in-memory buffer to child’s stdin.