pub trait RawHash {
    // Required method
    unsafe fn raw_hash(ptr: *const c_void) -> u64;

    // Provided method
    fn raw_hash_cb(
    ) -> Unsafe<&'static (dyn Fn(*const c_void) -> u64 + Send + Sync)> { ... }
}
Expand description

Trait implemented automatically for types that implement Hash and can be used compute a u64 hash for a type using a pointer to it.

Required Methods§

unsafe fn raw_hash(ptr: *const c_void) -> u64

Get the hash of the type.

Safety

The pointer must be aligned, readable, and be a pointer to the type that this Hash function was created for.

Provided Methods§

fn raw_hash_cb( ) -> Unsafe<&'static (dyn Fn(*const c_void) -> u64 + Send + Sync)>

Get a callback suitable for [SchemaData].

Object Safety§

This trait is not object safe.

Implementors§

§

impl<T> RawHash for Twhere T: Hash,