p3_util

Function apply_to_chunks

Source
pub fn apply_to_chunks<const BUFLEN: usize, I, H>(input: I, func: H)
where I: IntoIterator<Item = u8>, H: FnMut(&[I::Item]),
Expand description

Split an interator into small arrays and apply func to each.

Repeatedly read BUFLEN elements from input into an array and pass the array to func as a slice. If less than BUFLEN elements are remaining, that smaller slice is passed to func (if it is non-empty) and the function returns.