Skip to main content

capture_lines

Function capture_lines 

Source
pub fn capture_lines<R: Read>(
    reader: R,
    buffer: &mut String,
    truncated: &mut bool,
    on_line: impl FnMut(&str),
)
Expand description

Capture text into a buffer with a size limit.

Reads lines from reader, calls on_line for each (e.g., to print to the terminal), and appends to the buffer until MAX_CAPTURE_BYTES is reached.