#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum RecordSize {
Bits24,
#[default]
Bits28,
Bits32,
}
impl RecordSize {
#[must_use]
pub const fn bits(self) -> u8 {
match self {
Self::Bits24 => 24,
Self::Bits28 => 28,
Self::Bits32 => 32,
}
}
#[must_use]
pub const fn node_bytes(self) -> usize {
match self {
Self::Bits24 => 6,
Self::Bits28 => 7,
Self::Bits32 => 8,
}
}
#[must_use]
pub const fn max_value(self) -> u64 {
match self {
Self::Bits24 => 1 << 24,
Self::Bits28 => 1 << 28,
Self::Bits32 => 1 << 32,
}
}
#[must_use]
pub const fn as_metadata(self) -> u16 {
self.bits() as u16
}
pub(crate) const ASCENDING: [Self; 3] = [Self::Bits24, Self::Bits28, Self::Bits32];
}