use crate::encoders::Encoder;
use crate::hashing::Hash;
pub(crate) trait SealedMinimality {
type SinglePhfBackend<H: Hash, E: Encoder>: crate::backends::BackendPhf<Hash = H>;
type PartitionedPhfBackend<H: Hash, E: Encoder>: crate::backends::BackendPhf<Hash = H>;
}
#[allow(private_bounds)]
pub trait Minimality: SealedMinimality {
const AS_BOOL: bool;
}
#[cfg(feature = "minimal")]
pub struct Minimal;
#[cfg(feature = "minimal")]
impl Minimality for Minimal {
const AS_BOOL: bool = true;
}
#[cfg(feature = "minimal")]
impl SealedMinimality for Minimal {
type SinglePhfBackend<H: Hash, E: Encoder> = <H as Hash>::MinimalSinglePhfBackend<E>;
type PartitionedPhfBackend<H: Hash, E: Encoder> = <H as Hash>::MinimalPartitionedPhfBackend<E>;
}
#[cfg(feature = "nonminimal")]
pub struct Nonminimal;
#[cfg(feature = "nonminimal")]
impl Minimality for Nonminimal {
const AS_BOOL: bool = false;
}
#[cfg(feature = "nonminimal")]
impl SealedMinimality for Nonminimal {
type SinglePhfBackend<H: Hash, E: Encoder> = <H as Hash>::NonminimalSinglePhfBackend<E>;
type PartitionedPhfBackend<H: Hash, E: Encoder> =
<H as Hash>::NonminimalPartitionedPhfBackend<E>;
}