pub trait HashStorer {
// Required methods
fn clear(&mut self);
fn get(&self) -> Option<u64>;
fn get_or_init<F>(&self, f: F) -> u64
where F: FnOnce() -> u64;
// Provided method
fn hash_one<T, H>(value: &T) -> u64
where T: ?Sized + Hash,
H: Hasher + Default,
Self: Default { ... }
}
Expand description
storage trait for storing hash status
Required Methods§
Sourcefn get_or_init<F>(&self, f: F) -> u64
fn get_or_init<F>(&self, f: F) -> u64
if stored hash code is uninit, call init func
return inited hash code
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.