Trait phf_shared::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.

Object Safety§

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 i128

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 u128

source§

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

source§

impl PhfHash for UncasedStr

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]

source§

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

source§

impl<'a, T: 'a + PhfHash + ?Sized> PhfHash for &'a T

source§

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

source§

impl<const N: usize> PhfHash for [bool; N]

source§

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

source§

impl<const N: usize> PhfHash for [char; N]

source§

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

source§

impl<const N: usize> PhfHash for [i8; N]

source§

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

source§

impl<const N: usize> PhfHash for [i16; N]

source§

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

source§

impl<const N: usize> PhfHash for [i32; N]

source§

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

source§

impl<const N: usize> PhfHash for [i64; N]

source§

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

source§

impl<const N: usize> PhfHash for [i128; N]

source§

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

source§

impl<const N: usize> PhfHash for [u8; N]

source§

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

source§

impl<const N: usize> PhfHash for [u16; N]

source§

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

source§

impl<const N: usize> PhfHash for [u32; N]

source§

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

source§

impl<const N: usize> PhfHash for [u64; N]

source§

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

source§

impl<const N: usize> PhfHash for [u128; N]

source§

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

Implementors§