v0.19.0
·
37 commits
to master
since this release
Features
Added bit_order (#483)
After much development, bit_order is now a supported attribute! Msb is still the default bit-order for all operations,
but if you need Lsb ordering, deku now has you covered.
For example, the following is now possible:
# #[derive(Debug, DekuRead, DekuWrite, PartialEq)]
#[deku(bit_order = "lsb")] // <--
pub struct SquashfsV3 {
#[deku(bits = "4")]
inode_type: u8,
#[deku(bits = "12")]
mode: u16,
uid: u8,
guid: u8,
mtime: u32,
inode_number: u32,
}
let data: &[u8] = &[
// inode_type
// ╭-----------
// |
// | mode
// ╭+-------- ...and so on
// || ||
// vv vv
0x31, 0x12, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
];If you were using our internal reader the following changed. As well as the leftover field now containing ordering.
- reader.read_bytes(exact.0, &mut bytes)?;
+ reader.read_bytes(exact.0, &mut bytes, Order::Lsb0)?;Added bytes ctx for CString (#497)
#[derive(PartialEq, Debug, DekuRead, DekuWrite)]
pub struct Data {
len: u8,
#[deku(bytes = "*len as usize")]
s: CString,
}Changed id_pat (#540)
The id_pat attribute has been restored to the behavior of 0.16.0, removing the seek and re-read.
Allow token streams for bytes attribute (#489)
# #[derive(Debug, PartialEq, DekuRead, DekuWrite)]
struct DekuTest {
field_a_size: u8,
#[deku(bytes = "*field_a_size as usize")]
field_a: u32,
}Updates
Arcsupport by @vhdirk (#522)- Update
no-std-io2to 0.9.0 and UpdatedMSRVto1.81(#529) - Add field support for
magicattribute (#503) - Add
NoSeektype for unseekableRead+Writeimpls (#487) - Add performance specializations for
countattribute +Vec<u8>(#481) Readermay now take ownership ofRead + Seektype. Thanks @wgreenburg (#521).