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: FingerprintTrait Implementations§
source§impl<T: Clone> Clone for WithStableHash<T>
impl<T: Clone> Clone for WithStableHash<T>
source§fn clone(&self) -> WithStableHash<T>
fn clone(&self) -> WithStableHash<T>
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<T> Deref for WithStableHash<T>
impl<T> Deref for WithStableHash<T>
source§impl<T: Hash> Hash for WithStableHash<T>
impl<T: Hash> Hash for WithStableHash<T>
source§impl<T: HashStable<CTX>, CTX> HashStable<CTX> for WithStableHash<T>
impl<T: HashStable<CTX>, CTX> HashStable<CTX> for WithStableHash<T>
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher)
source§impl<T: Ord> Ord for WithStableHash<T>
impl<T: Ord> Ord for WithStableHash<T>
source§fn cmp(&self, other: &WithStableHash<T>) -> Ordering
fn cmp(&self, other: &WithStableHash<T>) -> 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<T: PartialEq> PartialEq<WithStableHash<T>> for WithStableHash<T>
impl<T: PartialEq> PartialEq<WithStableHash<T>> for WithStableHash<T>
source§impl<T: Ord> PartialOrd<WithStableHash<T>> for WithStableHash<T>
impl<T: Ord> PartialOrd<WithStableHash<T>> for WithStableHash<T>
source§fn partial_cmp(&self, other: &WithStableHash<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &WithStableHash<T>) -> 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<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§
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.