Skip to main content

count_lines

Function count_lines 

Source
pub fn count_lines(payload: &[u8]) -> usize
Available on crate feature worker-batch and (crate features worker-batch or worker-pool or worker) only.
Expand description

Count the number of NDJSON lines in a payload without allocating.

Useful for pre-sizing buffers before splitting.