It is unsafe to view an arbitrary type as bytes because it might contain uninitialized padding bytes.
zerocopy solves this with a derive macro but it is a bit limited (it doesn't work with generics, and implementing it manually is discouraged)
Unfortunately many types in this crate have padding, so there isn't really a great alternative π
It is unsafe to view an arbitrary type as bytes because it might contain uninitialized padding bytes.
zerocopysolves this with a derive macro but it is a bit limited (it doesn't work with generics, and implementing it manually is discouraged)Unfortunately many types in this crate have padding, so there isn't really a great alternative π