[−][src]Trait packing::Packed
Trait that enables packing and unpacking to/from byte slices
This is the trait that the proc macro implements on structs. Supports arbitrary field alignment - i.e. fields needn't start or end on 8-bit byte boundaries. For example, 2 bools, a 10-bit number and a 4-bit number could be packed into a pair of bytes such that the 10-bit number straddles them and doesn't align with any byte boundaries
Allowing arbitray field alignment should be zero-cost as the field definitions will all be constants.