packed_struct.rs
packed_struct.rs copied to clipboard
usize fields
Thanks for maintaining this great crate!
I can't seem to figure out how to have a PackedStruct whose fields are usize. Is there any intention to support this as long as the user asserts a width for the usize?
Thanks kindly
#[derive(Clone, Debug, PackedStruct)]
#[packed_struct(endian = "lsb")]
pub struct BoolMetadata {
#[packed_field(element_size_bits = "8", ty = "enum")]
validity: ValidityMetadata,
#[packed_field(element_size_bits = "8")]
length: usize,
#[packed_field(element_size_bits = "8")]
bit_offset: usize,
}