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 more
sourceimpl<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>
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>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
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 more
impl<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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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 T where
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.