2 ms·
It's likely that the "safe transmute" working group[1] will help facilitate this sort of thing. They have an RFC[2]. See also the bytemuck[3] and zerocopy[4] cr
by burntsushi 6y ago
It's likely that the "safe transmute" working group[1] will help facilitate this sort of thing. They have an RFC[2]. See also the bytemuck[3] and zerocopy[4] crates which predate the RFC, where at least the latter has 'derive' functionality.
[1] - https://github.com/rust-lang/project-safe-transmute https://github.com/rust-lang/project-safe-transmute
[2] - https://github.com/jswrenn/project-safe-transmute/blob/rfc/rfcs/0000-safe-transmute.md#safe-transmute-rfc https://github.com/jswrenn/project-safe-transmute/blob/rfc/r...
[3] - https://docs.rs/bytemuck/1.5.0/bytemuck/ https://docs.rs/bytemuck/1.5.0/bytemuck/
[4] - https://docs.rs/zerocopy/0.3.0/zerocopy/index.html https://docs.rs/zerocopy/0.3.0/zerocopy/index.html