Crate bytelines

source ·
Expand description

Bytelines is a simple library crate which offers line iteration for BufRead via &[u8] rather than String.

Due to the removal of checking for String validity, this is typically much faster for reading in raw data and much more flexible. The APIs offered in this crate are intended to function exactly the same as the lines function inside the BufRead trait, except that the bytes which precede the line delimiter are not validated.

Performance of ByteLines is very close to that of writing a loop manually, whereas RefByteLines is practically identical due to the avoidance of “unnecessary” allocations.

Structs

Provides a safe iterator over lines of input as byte vectors (Vec<u8>).
Provides an iterator over lines of input as byte slices (&[u8]).

Traits

Represents anything which can provide iterators of byte lines.