Struct rustc_data_structures::stable_hasher::StableHasher
source · pub struct StableHasher {
state: SipHasher128,
}
Expand description
When hashing something that ends up affecting properties like symbol names, we want these symbol names to be calculated independently of other factors like what architecture you’re compiling from.
To that end we always convert integers to little-endian format before
hashing and the architecture dependent isize
and usize
types are
extended to 64 bits if needed.
Fields§
§state: SipHasher128
Implementations§
source§impl StableHasher
impl StableHasher
pub fn new() -> Self
pub fn finish<W: StableHasherResult>(self) -> W
Trait Implementations§
source§impl Debug for StableHasher
impl Debug for StableHasher
source§impl Hasher for StableHasher
impl Hasher for StableHasher
source§fn write_str(&mut self, s: &str)
fn write_str(&mut self, s: &str)
🔬This is a nightly-only experimental API. (
hasher_prefixfree_extras
)Writes a single
str
into this hasher. Read moresource§fn write_length_prefix(&mut self, len: usize)
fn write_length_prefix(&mut self, len: usize)
🔬This is a nightly-only experimental API. (
hasher_prefixfree_extras
)Writes a length prefix into this hasher, as part of being prefix-free. Read more
source§fn write_u128(&mut self, i: u128)
fn write_u128(&mut self, i: u128)
Writes a single
u128
into this hasher.source§fn write_usize(&mut self, i: usize)
fn write_usize(&mut self, i: usize)
Writes a single
usize
into this hasher.source§fn write_i128(&mut self, i: i128)
fn write_i128(&mut self, i: i128)
Writes a single
i128
into this hasher.source§fn write_isize(&mut self, i: isize)
fn write_isize(&mut self, i: isize)
Writes a single
isize
into this hasher.Auto Trait Implementations§
impl DynSend for StableHasher
impl DynSync for StableHasher
impl Freeze for StableHasher
impl RefUnwindSafe for StableHasher
impl Send for StableHasher
impl Sync for StableHasher
impl Unpin for StableHasher
impl UnwindSafe for StableHasher
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 120 bytes