-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Labels
enhancementNew feature or requestNew feature or request
Description
#[derive(BinRead)]
#[br(little)]
// Is 7+ bytes but needs to get padded to `arbitrary`
pub struct Bar {
f1: u8,
f2: u16,
len: u32,
#[br(count = len)]
v: Vec<u8>
}
#[derive(BinRead)]
pub struct Foo {
arbitrary: u8,
len: u8,
#[br(pad_size_to = arbitrary, count = len)]
pub list: Vec<Bar>
}
// passing [
// 12, 2,
// 1, 2, 0, // f1, f2
// 1, 0, 0, 0, // len
// 42, // list
// 0, 0, 0, 0, // padding
// 4, 5, 0, // f1, f2
// 2, 0, 0, 0, // len
// 41, 43 // list
// 0, 0, 0 // padding
// ]
// should return Foo { arbitrary: 8, len: 2, list: vec![Bar {f1: 1, f2: 2, len: 1, list: vec![42]}] }This doesn't currently work
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request