Skip to main content

parse_and_map

Function parse_and_map 

Source
pub fn parse_and_map<F, R>(raw_packets: &[Vec<u8>], f: F) -> Vec<R>
where F: Fn(&Packet) -> R + Sync + Send, R: Send,
Expand description

Parse and immediately apply a transform in parallel.

This is more efficient than parse_batch + par_map because it avoids materializing the intermediate Vec<Packet>.