3 releases (1 stable)
1.0.0 | Nov 26, 2023 |
---|---|
0.1.1 | Mar 30, 2023 |
0.1.0 | Mar 30, 2023 |
#1461 in Rust patterns
63 downloads per month
Used in imagine
25KB
838 lines
Docs.rs
pack1
Byte array newtypes for different primitive types.
lib.rs
:
Byte array newtypes for different primitive types.
Because they're newtypes of byte arrays, they always have alignment 1.
Each type has new
and get
functions, as well as From
impls. The
new
and get
functions are const fn
with int types, but not yet with
floating types.
The intended usage of this crate is that you can use these these types in a
repr(C)
struct, along with manual padding, and then have each field at the
exact byte offset you desire (and with the necessary endian-ness), without
the normal repr(packed)
problem that it interferes with references.
Dependencies
~140KB