Trait std::hash::Hash
[−]
[src]
pub trait Hash {
fn hash<H>(&self, state: &mut H) where H: Hasher;
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher { ... }
}A hashable type.
The H type parameter is an abstract hash state that is used by the Hash
to compute the hash.
If you are also implementing Eq, there is an additional property that
is important:
k1 == k2 -> hash(k1) == hash(k2)
In other words, if two keys are equal, their hashes should also be equal.
HashMap and HashSet both rely on this behavior.
This trait can be used with #[derive].
Required Methods
fn hash<H>(&self, state: &mut H) where H: Hasher
Feeds this value into the state given, updating the hasher as necessary.
Provided Methods
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher1.3.0
Feeds a slice of this type into the state provided.
Implementors
impl<T> Hash for *mut Timpl<T> Hash for *const Timpl<T> Hash for [T] where T: Hashimpl<A, B, C, D, E, F, G, H, I, J, K, L> Hash for (A, B, C, D, E, F, G, H, I, J, K, L) where I: Hash, K: Hash, G: Hash, D: Hash, A: Hash, L: Hash, J: Hash, H: Hash, F: Hash, E: Hash, B: Hash, C: Hashimpl<A, B, C, D, E, F, G, H, I, J, K> Hash for (A, B, C, D, E, F, G, H, I, J, K) where J: Hash, C: Hash, K: Hash, D: Hash, A: Hash, I: Hash, G: Hash, B: Hash, H: Hash, E: Hash, F: Hashimpl<A, B, C, D, E, F, G, H, I, J> Hash for (A, B, C, D, E, F, G, H, I, J) where B: Hash, E: Hash, A: Hash, D: Hash, G: Hash, I: Hash, C: Hash, F: Hash, H: Hash, J: Hashimpl<A, B, C, D, E, F, G, H, I> Hash for (A, B, C, D, E, F, G, H, I) where F: Hash, C: Hash, G: Hash, A: Hash, E: Hash, B: Hash, D: Hash, H: Hash, I: Hashimpl<A, B, C, D, E, F, G, H> Hash for (A, B, C, D, E, F, G, H) where F: Hash, E: Hash, D: Hash, H: Hash, B: Hash, G: Hash, C: Hash, A: Hashimpl<A, B, C, D, E, F, G> Hash for (A, B, C, D, E, F, G) where B: Hash, F: Hash, D: Hash, C: Hash, E: Hash, A: Hash, G: Hashimpl<A, B, C, D, E, F> Hash for (A, B, C, D, E, F) where C: Hash, B: Hash, E: Hash, A: Hash, F: Hash, D: Hashimpl<A, B, C, D, E> Hash for (A, B, C, D, E) where D: Hash, A: Hash, C: Hash, B: Hash, E: Hashimpl<A, B, C, D> Hash for (A, B, C, D) where A: Hash, D: Hash, C: Hash, B: Hashimpl<A, B, C> Hash for (A, B, C) where B: Hash, C: Hash, A: Hashimpl<A, B> Hash for (A, B) where B: Hash, A: Hashimpl<A> Hash for (A,) where A: Hashimpl Hash for ()impl Hash for strimpl Hash for charimpl Hash for boolimpl Hash for isizeimpl Hash for i64impl Hash for i32impl Hash for i16impl Hash for i8impl Hash for usizeimpl Hash for u64impl Hash for u32impl Hash for u16impl Hash for u8impl<T> Hash for [T; 32] where T: Hashimpl<T> Hash for [T; 31] where T: Hashimpl<T> Hash for [T; 30] where T: Hashimpl<T> Hash for [T; 29] where T: Hashimpl<T> Hash for [T; 28] where T: Hashimpl<T> Hash for [T; 27] where T: Hashimpl<T> Hash for [T; 26] where T: Hashimpl<T> Hash for [T; 25] where T: Hashimpl<T> Hash for [T; 24] where T: Hashimpl<T> Hash for [T; 23] where T: Hashimpl<T> Hash for [T; 22] where T: Hashimpl<T> Hash for [T; 21] where T: Hashimpl<T> Hash for [T; 20] where T: Hashimpl<T> Hash for [T; 19] where T: Hashimpl<T> Hash for [T; 18] where T: Hashimpl<T> Hash for [T; 17] where T: Hashimpl<T> Hash for [T; 16] where T: Hashimpl<T> Hash for [T; 15] where T: Hashimpl<T> Hash for [T; 14] where T: Hashimpl<T> Hash for [T; 13] where T: Hashimpl<T> Hash for [T; 12] where T: Hashimpl<T> Hash for [T; 11] where T: Hashimpl<T> Hash for [T; 10] where T: Hashimpl<T> Hash for [T; 9] where T: Hashimpl<T> Hash for [T; 8] where T: Hashimpl<T> Hash for [T; 7] where T: Hashimpl<T> Hash for [T; 6] where T: Hashimpl<T> Hash for [T; 5] where T: Hashimpl<T> Hash for [T; 4] where T: Hashimpl<T> Hash for [T; 3] where T: Hashimpl<T> Hash for [T; 2] where T: Hashimpl<T> Hash for [T; 1] where T: Hashimpl<T> Hash for [T; 0] where T: Hashimpl Hash for TypeIdimpl<T> Hash for PhantomData<T> where T: ?Sizedimpl<T, E> Hash for Result<T, E> where T: Hash, E: Hashimpl<T> Hash for Option<T> where T: Hashimpl<T> Hash for Box<T> where T: Hash + ?Sizedimpl<T> Hash for Rc<T> where T: Hash + ?Sizedimpl<'a, B> Hash for Cow<'a, B> where B: Hash + ToOwned + ?Sizedimpl Hash for Stringimpl<T> Hash for Vec<T> where T: Hashimpl<T> Hash for Bound<T> where T: Hashimpl<K, V> Hash for BTreeMap<K, V> where K: Hash, V: Hashimpl<T> Hash for BTreeSet<T> where T: Hashimpl<A> Hash for LinkedList<A> where A: Hashimpl<A> Hash for VecDeque<A> where A: Hashimpl Hash for CStringimpl Hash for CStrimpl Hash for OsStringimpl Hash for OsStrimpl Hash for FileTypeimpl Hash for IpAddrimpl Hash for Ipv6MulticastScopeimpl Hash for Ipv4Addrimpl Hash for Ipv6Addrimpl Hash for SocketAddrimpl Hash for SocketAddrV4impl Hash for SocketAddrV6impl<'a> Hash for Prefix<'a>impl<'a> Hash for PrefixComponent<'a>impl<'a> Hash for Component<'a>impl Hash for PathBufimpl Hash for Pathimpl<T> Hash for Arc<T> where T: Hash + ?Sizedimpl Hash for Duration