Skip to main content

HashWork

Trait HashWork 

Source
pub trait HashWork: Hash + Eq {
    // Required method
    fn hash_work(&self) -> Result<u64, MemoryError>;
}
Expand description

A trusted key type’s upper bound for hashing and equality work.

Implementations must cover all bytes examined by Hash and Eq. This is a contract for caller-provided code, not a value an untrusted document supplies. The bound must remain unchanged and successful while a key is stored, just as Hash and Eq must remain stable. Accounting retains this bound for rehashes.

Required Methods§

Source

fn hash_work(&self) -> Result<u64, MemoryError>

Work units for one hash/equality traversal, including constant overhead.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl HashWork for &[u8]

Source§

impl HashWork for (Oid<'_>, Oid<'_>)

Source§

impl HashWork for (usize, usize, usize)

Source§

impl HashWork for str

Source§

impl HashWork for u8

Source§

impl HashWork for usize

Implementors§