pub fn count<R, T, Arg, Ret>(
n: usize,
) -> impl Fn(&mut R, &ReadOptions, Arg) -> BinResult<Ret>
Expand description
A helper equivelant to #[br(count = N)]
which can be used with any collection.
ยงExamples
#[derive(BinRead)]
struct CountBytes {
len: u8,
#[br(parse_with = count(len as usize))]
data: Vec<u8>,
}