-
I've got a struct that's Copy, Clone, repr(C,packed), bytemuck::NoUninit, and bytemuck::Zeroable — but it is not bytemuck::AnyBitPattern due to being slightly value-constrained (certain fields have certain bits clamped to 0 when creating the type). I have an array of this struct, and I need to lend this array as a Is there any plan for a |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You can use |
Beta Was this translation helpful? Give feedback.
-
In addition to what zachs said, casting any type that |
Beta Was this translation helpful? Give feedback.
You can use
bytemuck::must_cast_ref
, assuming you have themin_const_generics
feature enabled, to cast from&T
(including&[U; _]
) to&[u8; N]