pub struct DefaultHashable<H: Hash>(pub H);Expand description
A wrapper type that provides Hashable for any type that is Hash.
As part of using Registry, the chosen key type must implement
Hashable. For use cases where performance is not the utmost concern and there is no desire
to deal with pre-hashing keys, DefaultHashable can be used to wrap the key type and provide
the implementation of Hashable so long as H itself is Hash.
Tuple Fields§
§0: HTrait Implementations§
Source§impl<H: Clone + Hash> Clone for DefaultHashable<H>
impl<H: Clone + Hash> Clone for DefaultHashable<H>
Source§fn clone(&self) -> DefaultHashable<H>
fn clone(&self) -> DefaultHashable<H>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<H: Hash> Hashable for DefaultHashable<H>
impl<H: Hash> Hashable for DefaultHashable<H>
Source§impl<H: Ord + Hash> Ord for DefaultHashable<H>
impl<H: Ord + Hash> Ord for DefaultHashable<H>
Source§fn cmp(&self, other: &DefaultHashable<H>) -> Ordering
fn cmp(&self, other: &DefaultHashable<H>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<H: PartialOrd + Hash> PartialOrd for DefaultHashable<H>
impl<H: PartialOrd + Hash> PartialOrd for DefaultHashable<H>
impl<H: Eq + Hash> Eq for DefaultHashable<H>
impl<H: Hash> StructuralPartialEq for DefaultHashable<H>
Auto Trait Implementations§
impl<H> Freeze for DefaultHashable<H>where
H: Freeze,
impl<H> RefUnwindSafe for DefaultHashable<H>where
H: RefUnwindSafe,
impl<H> Send for DefaultHashable<H>where
H: Send,
impl<H> Sync for DefaultHashable<H>where
H: Sync,
impl<H> Unpin for DefaultHashable<H>where
H: Unpin,
impl<H> UnwindSafe for DefaultHashable<H>where
H: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.