Skip to main content

ExportableBuildHasher

Trait ExportableBuildHasher 

Source
pub trait ExportableBuildHasher: BuildHasher + Clone {
    const NAME: &str;

    // Required methods
    fn write_to(&self, writer: impl Write) -> Result<()>;
    fn read_from(reader: impl Read) -> Result<Self>;
}
Expand description

A trait representing BuildHasher instances that can be exported (e.g. persisted into a file).

This trait is needed for [cuckoo_clock::CuckooFilter::export].

Required Associated Constants§

Source

const NAME: &str

Unique of this ExportableBuildHasher. This will be stored in the header of exported data.

Required Methods§

Source

fn write_to(&self, writer: impl Write) -> Result<()>

Writes the inner state of this instance into the provided writer.

Source

fn read_from(reader: impl Read) -> Result<Self>

Reads the stored inner state to create an instance of this hasher.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl ExportableBuildHasher for ExportableRandomState

Source§

const NAME: &str = "cuckoo_clock::exporter::ExportableRandomState"