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 RefUnwindSafe for StableHasher
impl Send for StableHasher
impl Sync for StableHasher
impl Unpin for StableHasher
impl UnwindSafe for StableHasher
Blanket Implementations§
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> Erased for T
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