Struct rustc_data_structures::intern::WithStableHash
source · pub struct WithStableHash<T> {
pub internee: T,
pub stable_hash: Fingerprint,
}
Expand description
A helper type that you can wrap round your own type in order to automatically cache the stable hash on creation and not recompute it whenever the stable hash of the type is computed. This is only done in incremental mode. You can also opt out of caching by using StableHash::ZERO for the hash, in which case the hash gets computed each time. This is useful if you have values that you intern but never (can?) use for stable hashing.
Fields
internee: T
stable_hash: Fingerprint
Trait Implementations
sourceimpl<T: Clone> Clone for WithStableHash<T>
impl<T: Clone> Clone for WithStableHash<T>
sourcefn clone(&self) -> WithStableHash<T>
fn clone(&self) -> WithStableHash<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<T> Deref for WithStableHash<T>
impl<T> Deref for WithStableHash<T>
sourceimpl<T: Hash> Hash for WithStableHash<T>
impl<T: Hash> Hash for WithStableHash<T>
sourceimpl<T: HashStable<CTX>, CTX: InternedHashingContext> HashStable<CTX> for WithStableHash<T>
impl<T: HashStable<CTX>, CTX: InternedHashingContext> HashStable<CTX> for WithStableHash<T>
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher)
sourceimpl<T: Ord> Ord for WithStableHash<T>
impl<T: Ord> Ord for WithStableHash<T>
sourcefn cmp(&self, other: &WithStableHash<T>) -> Ordering
fn cmp(&self, other: &WithStableHash<T>) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: PartialEq> PartialEq<WithStableHash<T>> for WithStableHash<T>
impl<T: PartialEq> PartialEq<WithStableHash<T>> for WithStableHash<T>
sourceimpl<T: Ord> PartialOrd<WithStableHash<T>> for WithStableHash<T>
impl<T: Ord> PartialOrd<WithStableHash<T>> for WithStableHash<T>
sourcefn partial_cmp(&self, other: &WithStableHash<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &WithStableHash<T>) -> Option<Ordering>
1.0.0 · sourcefn 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<T: Copy> Copy for WithStableHash<T>
impl<T: Eq> Eq for WithStableHash<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for WithStableHash<T>where
T: RefUnwindSafe,
impl<T> Send for WithStableHash<T>where
T: Send,
impl<T> Sync for WithStableHash<T>where
T: Sync,
impl<T> Unpin for WithStableHash<T>where
T: Unpin,
impl<T> UnwindSafe for WithStableHash<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> Erased for T
Layout
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.