pub trait CacheKey {
// Required method
fn cache_key(&self, state: &mut CacheKeyHasher);
// Provided method
fn cache_key_slice(data: &[Self], state: &mut CacheKeyHasher)
where Self: Sized { ... }
}Expand description
A trait for types that can be hashed in a stable way across versions and platforms. Equivalent
to Ruff’s CacheKey trait.
Required Methods§
fn cache_key(&self, state: &mut CacheKeyHasher)
Provided Methods§
fn cache_key_slice(data: &[Self], state: &mut CacheKeyHasher)where
Self: Sized,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".