Trait bones_schema::raw_fns::RawHash

source ·
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 + Sync + Send + 'static)> { ... }
}
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§

source

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§

source

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

Get a callback suitable for SchemaData.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Hash> RawHash for T