Crate size_of_no_padding_derive

Crate size_of_no_padding_derive 

Source

Derive Macros§

SizeOfNoPadding
Create a shadow struct which as same as original struct except it’s marked #[repr(packed)]. call size_of_no_padding() method on struct will invoke std::mem::size_of() function on shadow one in compile time.
SizeOfNoPaddingAny
Calculate the size for every field, add up all the size. call size_of_no_padding_any(&self) will give the size of whole struct without padding in runtime.