Trait DeterministicHasher

Source
pub trait DeterministicHasher {
Show 14 methods // Required methods fn finish(&self) -> u64; fn write_bytes(&mut self, bytes: &[u8]); // Provided methods fn write_u8(&mut self, i: u8) { ... } fn write_usize(&mut self, i: usize) { ... } fn write_isize(&mut self, i: isize) { ... } fn write_u16(&mut self, i: u16) { ... } fn write_u32(&mut self, i: u32) { ... } fn write_u64(&mut self, i: u64) { ... } fn write_i8(&mut self, i: i8) { ... } fn write_i16(&mut self, i: i16) { ... } fn write_i32(&mut self, i: i32) { ... } fn write_i64(&mut self, i: i64) { ... } fn write_u128(&mut self, i: u128) { ... } fn write_i128(&mut self, i: i128) { ... }
}
Expand description

Signals the implementor can safely hash in a replicatable way across platforms and process runs.

Note that the default std::hash::Hash trait used by Rust allows for hashing that differs across process runs, so it is not suitable for persistent caching with turbo-tasks.

Required Methods§

Source

fn finish(&self) -> u64

Source

fn write_bytes(&mut self, bytes: &[u8])

Provided Methods§

Source

fn write_u8(&mut self, i: u8)

Writes a single u8 to this hasher

Source

fn write_usize(&mut self, i: usize)

Writes a single usize to this hasher

Source

fn write_isize(&mut self, i: isize)

Writes a single isize to this hasher

Source

fn write_u16(&mut self, i: u16)

Writes a single $ty to this hasher

Source

fn write_u32(&mut self, i: u32)

Writes a single $ty to this hasher

Source

fn write_u64(&mut self, i: u64)

Writes a single $ty to this hasher

Source

fn write_i8(&mut self, i: i8)

Writes a single $ty to this hasher

Source

fn write_i16(&mut self, i: i16)

Writes a single $ty to this hasher

Source

fn write_i32(&mut self, i: i32)

Writes a single $ty to this hasher

Source

fn write_i64(&mut self, i: i64)

Writes a single $ty to this hasher

Source

fn write_u128(&mut self, i: u128)

Writes a single $ty to this hasher

Source

fn write_i128(&mut self, i: i128)

Writes a single $ty to this hasher

Implementors§