Struct metrics_util::DefaultHashable
source · 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: H
Trait 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 copy 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: PartialEq + Hash> PartialEq for DefaultHashable<H>
impl<H: PartialEq + Hash> PartialEq for DefaultHashable<H>
source§fn eq(&self, other: &DefaultHashable<H>) -> bool
fn eq(&self, other: &DefaultHashable<H>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<H: PartialOrd + Hash> PartialOrd for DefaultHashable<H>
impl<H: PartialOrd + Hash> PartialOrd for DefaultHashable<H>
source§fn partial_cmp(&self, other: &DefaultHashable<H>) -> Option<Ordering>
fn partial_cmp(&self, other: &DefaultHashable<H>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<H: Eq + Hash> Eq for DefaultHashable<H>
impl<H: Hash> StructuralEq for DefaultHashable<H>
impl<H: Hash> StructuralPartialEq for DefaultHashable<H>
Auto Trait Implementations§
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