Expand description
Provides byte stream parsing utilities.
ⓘ
let reader = File::open("..."); // reader is anything that implements io::Read
let alloc_size = 1000; // Set custom allocation size
let muncher = ReadMuncher::<DataItem, _>::new(&reader, alloc_size, |bytes, is_eof| {
// parse function here
});
for packet in &muncher {
// packet is DataItem
}
Structs§
- Read
Muncher - Continuously reads bytes from a
Readimplementor, parses that byte stream with the provided parser function, and provides an iterator over the parsed slices/packets/frames.
Type Aliases§
- Munch
Output - Output type for
ReadMuncherparse function