#![cfg_attr(all(feature = "minimal", feature = "nonminimal", feature = "dictionary_dictionary", feature = "hash64"), doc = include_str!("../README.md"))]
use std::path::Path;
use cxx::Exception;
#[cfg(feature = "rayon")]
use rayon::prelude::*;
pub mod build;
pub use build::*;
mod backends;
pub mod encoders;
pub use encoders::*;
pub mod hashing;
pub use hashing::*;
pub mod minimality;
pub use minimality::*;
mod partitioned_phf;
pub use partitioned_phf::*;
mod structs;
mod single_phf;
pub use single_phf::*;
mod utils;
#[allow(unused_imports)] pub use utils::*;
pub trait Phf: Sized + Send + Sync {
const MINIMAL: bool;
fn build_in_internal_memory_from_bytes<Keys: IntoIterator>(
&mut self,
keys: impl FnMut() -> Keys,
config: &BuildConfiguration,
) -> Result<BuildTimings, Exception>
where
<<Keys as IntoIterator>::IntoIter as Iterator>::Item: Hashable;
#[cfg(feature = "rayon")]
fn par_build_in_internal_memory_from_bytes<Keys: IntoParallelIterator>(
&mut self,
keys: impl FnMut() -> Keys,
config: &BuildConfiguration,
) -> Result<BuildTimings, Exception>
where
<<Keys as IntoParallelIterator>::Iter as ParallelIterator>::Item: Hashable;
fn hash(&self, key: impl Hashable) -> u64;
fn num_bits(&self) -> usize;
fn num_keys(&self) -> u64;
fn table_size(&self) -> u64;
fn save(&mut self, path: impl AsRef<Path>) -> Result<usize, Exception>;
fn load(path: impl AsRef<Path>) -> Result<Self, Exception>;
}