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]

Trait Implementations

impl Default for MurmurHasher
[src]

Returns the "default value" for a type. Read more

impl Hasher for MurmurHasher
[src]

Completes a round of hashing, producing the output hash generated.

Writes some data into this Hasher

Write a single u8 into this hasher

Write a single u16 into this hasher.

Write a single u32 into this hasher.

Write a single u64 into this hasher.

Write a single usize into this hasher.

Write a single i8 into this hasher.

Write a single i16 into this hasher.

Write a single i32 into this hasher.

Write a single i64 into this hasher.

Write a single isize into this hasher.