Derive Macro bytemuck::ByteHash

source ·
Expand description

Derive the Hash trait for a type

The macro implements Hash by casting the value to a byte slice and hashing that.


The hash does not match the standard library’s Hash derive.


#[derive(Copy, Clone, NoUninit, ByteHash)]
struct Test {
  a: u32,
  b: char,
  c: f32,