Skip to main content

lines_of

Function lines_of 

Source
fn lines_of(
    data: &[u8],
    from: u64,
    mid_line: bool,
    from_end: bool,
    max: usize,
) -> Lines
Expand description

The whole lines in data, which starts at byte from of the file. mid_line: from may fall inside a line, so the first piece is dropped. from_end: keep the last max lines (a replay) rather than the first (a tail). A last line with no newline yet is not returned and next stays before it.