Struct murmurhash64::MurmurHasher
[−]
[src]
pub struct MurmurHasher { /* fields omitted */ }
MurmurHash2 can also be used as the hash algorithm in a HashMap (or similar). It implements the necessary traits.
The new hasher traits are only available since Rust 1.7.0
To use them, enable the hasher
feature in your build.
Basic Example
let mut hashmap : HashMap<_, _, MurmurState> = Default::default(); hashmap.insert("abc", 123); hashmap.insert("def", 456); assert_eq!(Some(&123), hashmap.get("abc")); assert_eq!(Some(&456), hashmap.get("def")); let mut hashmap : HashMap<_, _, RandomMurmurState> = Default::default(); hashmap.insert("abc", 123); hashmap.insert("def", 456); assert_eq!(Some(&123), hashmap.get("abc")); assert_eq!(Some(&456), hashmap.get("def"));Run
Methods
impl MurmurHasher
[src]
fn new() -> MurmurHasher
fn with_seed(seed: u64) -> MurmurHasher
Trait Implementations
impl Default for MurmurHasher
[src]
fn default() -> MurmurHasher
Returns the "default value" for a type. Read more
impl Hasher for MurmurHasher
[src]
fn finish(&self) -> u64
Completes a round of hashing, producing the output hash generated.
fn write(&mut self, buf: &[u8])
Writes some data into this Hasher
fn write_u8(&mut self, i: u8)
1.3.0
Write a single u8
into this hasher
fn write_u16(&mut self, i: u16)
1.3.0
Write a single u16
into this hasher.
fn write_u32(&mut self, i: u32)
1.3.0
Write a single u32
into this hasher.
fn write_u64(&mut self, i: u64)
1.3.0
Write a single u64
into this hasher.
fn write_usize(&mut self, i: usize)
1.3.0
Write a single usize
into this hasher.
fn write_i8(&mut self, i: i8)
1.3.0
Write a single i8
into this hasher.
fn write_i16(&mut self, i: i16)
1.3.0
Write a single i16
into this hasher.
fn write_i32(&mut self, i: i32)
1.3.0
Write a single i32
into this hasher.
fn write_i64(&mut self, i: i64)
1.3.0
Write a single i64
into this hasher.
fn write_isize(&mut self, i: isize)
1.3.0
Write a single isize
into this hasher.