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`Htype parameter is an abstract hash state that is used by the` type parameter is an abstract hash state that is used by the Hash`Hash`
to compute the hash.
If you are also implementing Eq`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`HashMapand` and HashSet`HashSet` both rely on this behavior.
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: Hasher
: module was recently redesigned
Feeds a slice of this type into the state provided.
Implementors
impl<T> Hash for NonZero<T> where T: Zeroable + Hash + Hashimpl<T> Hash for PhantomData<T> where T: ?Sizedimpl Hash for TypeIdimpl<T> Hash for [T; 0] where T: Hashimpl<T> Hash for [T; 1] where T: Hashimpl<T> Hash for [T; 2] where T: Hashimpl<T> Hash for [T; 3] where T: Hashimpl<T> Hash for [T; 4] where T: Hashimpl<T> Hash for [T; 5] where T: Hashimpl<T> Hash for [T; 6] where T: Hashimpl<T> Hash for [T; 7] where T: Hashimpl<T> Hash for [T; 8] where T: Hashimpl<T> Hash for [T; 9] where T: Hashimpl<T> Hash for [T; 10] where T: Hashimpl<T> Hash for [T; 11] where T: Hashimpl<T> Hash for [T; 12] where T: Hashimpl<T> Hash for [T; 13] where T: Hashimpl<T> Hash for [T; 14] where T: Hashimpl<T> Hash for [T; 15] where T: Hashimpl<T> Hash for [T; 16] where T: Hashimpl<T> Hash for [T; 17] where T: Hashimpl<T> Hash for [T; 18] where T: Hashimpl<T> Hash for [T; 19] where T: Hashimpl<T> Hash for [T; 20] where T: Hashimpl<T> Hash for [T; 21] where T: Hashimpl<T> Hash for [T; 22] where T: Hashimpl<T> Hash for [T; 23] where T: Hashimpl<T> Hash for [T; 24] where T: Hashimpl<T> Hash for [T; 25] where T: Hashimpl<T> Hash for [T; 26] where T: Hashimpl<T> Hash for [T; 27] where T: Hashimpl<T> Hash for [T; 28] where T: Hashimpl<T> Hash for [T; 29] where T: Hashimpl<T> Hash for [T; 30] where T: Hashimpl<T> Hash for [T; 31] where T: Hashimpl<T> Hash for [T; 32] where T: Hashimpl<T> Hash for Option<T> where T: Hash + Hashimpl<T, E> Hash for Result<T, E> where E: Hash + Hash, T: Hash + Hashimpl Hash for u8impl Hash for u16impl Hash for u32impl Hash for u64impl Hash for usizeimpl Hash for i8impl Hash for i16impl Hash for i32impl Hash for i64impl Hash for isizeimpl Hash for boolimpl Hash for charimpl Hash for strimpl Hash for ()impl<A> Hash for (A,) where A: Hashimpl<A, B> Hash for (A, B) where B: Hash, A: Hashimpl<A, B, C> Hash for (A, B, C) where A: Hash, C: Hash, B: Hashimpl<A, B, C, D> Hash for (A, B, C, D) where D: Hash, C: Hash, B: Hash, A: Hashimpl<A, B, C, D, E> Hash for (A, B, C, D, E) where A: Hash, C: Hash, B: Hash, E: Hash, D: Hashimpl<A, B, C, D, E, F> Hash for (A, B, C, D, E, F) where F: Hash, B: Hash, D: Hash, C: Hash, A: Hash, E: Hashimpl<A, B, C, D, E, F, G> Hash for (A, B, C, D, E, F, G) where F: Hash, E: Hash, C: Hash, B: Hash, A: Hash, D: Hash, G: Hashimpl<A, B, C, D, E, F, G, H> Hash for (A, B, C, D, E, F, G, H) where H: Hash, B: Hash, A: Hash, G: Hash, E: Hash, D: Hash, C: Hash, F: Hashimpl<A, B, C, D, E, F, G, H, I> Hash for (A, B, C, D, E, F, G, H, I) where B: Hash, F: Hash, H: Hash, I: Hash, E: Hash, C: Hash, A: Hash, D: Hash, G: Hashimpl<A, B, C, D, E, F, G, H, I, J> Hash for (A, B, C, D, E, F, G, H, I, J) where G: Hash, E: Hash, C: Hash, H: Hash, A: Hash, J: Hash, B: Hash, I: Hash, D: Hash, F: 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 K: Hash, J: Hash, E: Hash, A: Hash, I: Hash, D: Hash, B: Hash, H: Hash, F: Hash, G: Hash, C: 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 C: Hash, G: Hash, F: Hash, J: Hash, H: Hash, D: Hash, A: Hash, I: Hash, K: Hash, L: Hash, E: Hash, B: Hashimpl<T> Hash for [T] where T: Hashimpl<'a, T> Hash for &'a T where T: Hash + ?Sizedimpl<'a, T> Hash for &'a mut T where T: Hash + ?Sizedimpl<T> Hash for *const Timpl<T> Hash for *mut Timpl<T> Hash for Box<T> where T: Hash + ?Sizedimpl<T> Hash for Arc<T> where T: Hashimpl<T> Hash for Rc<T> where T: Hash + ?Sizedimpl Hash for BitVecimpl Hash for BitSetimpl<K, V> Hash for BTreeMap<K, V> where K: Hash, V: Hashimpl<T> Hash for BTreeSet<T> where T: Hash + Hashimpl<'a, B> Hash for Cow<'a, B> where B: Hash + ToOwned + ?Sizedimpl<E> Hash for EnumSet<E> where E: Hash + Hashimpl<A> Hash for LinkedList<A> where A: Hashimpl Hash for Stringimpl<T> Hash for Vec<T> where T: Hashimpl<A> Hash for VecDeque<A> where A: Hashimpl<V> Hash for VecMap<V> where V: Hashimpl<T> Hash for Bound<T> where T: Hash + Hash + 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 Path