phf_shared

Trait PhfHash

Source
pub trait PhfHash {
    // Required method
    fn phf_hash<H: Hasher>(&self, state: &mut H);

    // Provided method
    fn phf_hash_slice<H: Hasher>(data: &[Self], state: &mut H)
       where Self: Sized { ... }
}
Expand description

A trait implemented by types which can be used in PHF data structures.

This differs from the standard library’s Hash trait in that PhfHash’s results must be architecture independent so that hashes will be consistent between the host and target when cross compiling.

Required Methods§

Source

fn phf_hash<H: Hasher>(&self, state: &mut H)

Feeds the value into the state given, updating the hasher as necessary.

Provided Methods§

Source

fn phf_hash_slice<H: Hasher>(data: &[Self], state: &mut H)
where Self: Sized,

Feeds a slice of this type into the state provided.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl PhfHash for bool

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for char

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for i8

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for i16

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for i32

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for i64

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for str

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for u8

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for u16

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for u32

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for u64

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for String

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for Vec<u8>

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 1]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 2]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 3]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 4]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 5]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 6]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 7]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 8]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 9]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 10]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 11]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 12]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 13]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 14]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 15]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 16]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 17]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 18]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 19]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 20]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 21]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 22]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 23]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 24]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 25]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 26]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 27]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 28]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 29]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 30]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 31]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8; 32]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl PhfHash for [u8]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl<'a> PhfHash for &'a str

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Source§

impl<'a> PhfHash for &'a [u8]

Source§

fn phf_hash<H: Hasher>(&self, state: &mut H)

Implementors§