Struct HashedGeneric

Source
pub struct HashedGeneric<T, V>
where T: ?Sized + Hash, V: AsPrimitive<u64> + Copy, u64: AsPrimitive<V>,
{ /* private fields */ }

Implementations§

Source§

impl<T, V> HashedGeneric<T, V>
where T: ?Sized + Hash, V: AsPrimitive<u64> + Copy, u64: AsPrimitive<V>,

Source

pub fn new(hashee: &T) -> Self

Create a new Hashed from &T. Note that this function doesn’t consume the input, so if it is later modified the hash will not update. To stop these kinds of errors, it is recommended to use the From or Into traits instead of this function whenever possible.

Source

pub fn value(&self) -> V

Get the actual hash value the Hashed is wrapping.

Trait Implementations§

Source§

impl<T, V> Clone for HashedGeneric<T, V>
where T: ?Sized + Hash + Clone, V: AsPrimitive<u64> + Copy + Clone, u64: AsPrimitive<V>,

Source§

fn clone(&self) -> HashedGeneric<T, V>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T, V> Debug for HashedGeneric<T, V>
where T: ?Sized + Hash, V: AsPrimitive<u64> + LowerHex + Copy, u64: AsPrimitive<V>,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T, V> Default for HashedGeneric<T, V>
where T: Hash + Default, V: AsPrimitive<u64> + Copy, u64: AsPrimitive<V>,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T, V> From<T> for HashedGeneric<T, V>
where T: Hash, V: AsPrimitive<u64> + Copy, u64: AsPrimitive<V>,

Source§

fn from(hashee: T) -> Self

Converts to this type from the input type.
Source§

impl<T, V> Hash for HashedGeneric<T, V>
where T: ?Sized + Hash + Hash, V: AsPrimitive<u64> + Copy + Hash, u64: AsPrimitive<V>,

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T, V> Into<u64> for HashedGeneric<T, V>
where T: ?Sized + Hash, V: AsPrimitive<u64> + Copy, u64: AsPrimitive<V>,

Source§

fn into(self) -> u64

Converts this type into the (usually inferred) input type.
Source§

impl<T, V> PartialEq for HashedGeneric<T, V>

Source§

fn eq(&self, other: &HashedGeneric<T, V>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T, V> Copy for HashedGeneric<T, V>
where T: ?Sized + Hash + Copy, V: AsPrimitive<u64> + Copy + Copy, u64: AsPrimitive<V>,

Source§

impl<T, V> Eq for HashedGeneric<T, V>
where T: ?Sized + Hash + Eq, V: AsPrimitive<u64> + Copy + Eq, u64: AsPrimitive<V>,

Source§

impl<T, V> StructuralPartialEq for HashedGeneric<T, V>
where T: ?Sized + Hash, V: AsPrimitive<u64> + Copy, u64: AsPrimitive<V>,

Auto Trait Implementations§

§

impl<T, V> Freeze for HashedGeneric<T, V>
where V: Freeze, T: ?Sized,

§

impl<T, V> RefUnwindSafe for HashedGeneric<T, V>

§

impl<T, V> Send for HashedGeneric<T, V>
where V: Send, T: Send + ?Sized,

§

impl<T, V> Sync for HashedGeneric<T, V>
where V: Sync, T: Sync + ?Sized,

§

impl<T, V> Unpin for HashedGeneric<T, V>
where V: Unpin, T: Unpin + ?Sized,

§

impl<T, V> UnwindSafe for HashedGeneric<T, V>
where V: UnwindSafe, T: UnwindSafe + ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsPrimitive<T> for T

Source§

fn as_(self) -> T

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.