You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 18, 2021. It is now read-only.
Currently, the buffers returned by Buffer::map_read and Buffer::map_write return types which can be safely converted to &[u8]. If a buffer contains a more complex struct, you either have to cast unsafely or build it manually.
If the BufferReadMapping and BufferWriteMapping structs had an type parameter (it could even be set to u8 by default for backwards compatibility) that was bounded on zerocopy::FromBytes or bytemuck::Pod, it'd be more convenient to safely cast the slice to a slice of an arbitrary type.
For example, BufferReadMapping could be implemented as: