For the inline representation (i.e., no dereference), you can view your element as a slice of bytes (Playground).
This outputs (version
} = [
The first four bytes are those of the
i32, in little-endian representation;
The following byte is the
And the last three bytes are padding bytes (whose contents are always undefined, IIRC).
I am unsure whether those padding bytes will always be there, since I suspect they exist so that the size of a
NewType(i32, u8), remains a multiple of the alignment, given that types cannot currently have a stride greater than their size.
(In a slice, for all but the first element to be properly aligned, each “previous element”, (i.e., every element except the last one) may have extra padding).
See the Unsafe Code Guidelines Reference.