#[non_exhaustive]pub enum Capture {
Discard,
Inherit,
Whole {
limit: usize,
over: OverLimit,
},
Tail {
limit: usize,
},
Lines {
queue: LineQueue,
line: usize,
total: usize,
over: OverLimit,
long: LongLine,
end: u8,
},
}Expand description
What a run keeps of one output stream of the child.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Discard
The stream goes to the null device, and the run keeps nothing.
Inherit
The stream goes to the tool’s own stream, and the run keeps nothing.
A child in a group of its own is in the background of the terminal.
It can write there unless the terminal has tostop set, and it is
stopped when it reads. A stopped child holds a run with no deadline. For a step that
the person answers, use Scope::Child with
Input::Inherit, so the child stays in the
tool’s foreground group and the tool carries on when it ends. Ctrl-C
then reaches both.
Whole
The run keeps the stream’s first limit bytes. A stream longer than
limit bytes is over its limit, and over says what the run does
then.
Fields
Tail
The run reads the whole stream and keeps its last limit bytes.
Lines
The run splits the stream into lines on each end byte and pushes
each line, without that byte, to queue while the child runs. A
last line with no end is pushed when the stream ends. The run
keeps no bytes in its Captured.
The first time the stream passes total bytes, the stream is over
its limit, and over says what the run does then. No line is pushed
after that. A line that passes line bytes does the same with
LongLine::Over, and with LongLine::Skip the run drops that
line alone and goes on.
Each queue serves one run, which ends it when it returns.
Fields
queue: LineQueueThe queue that the run pushes each line to, from
line_queue.