use crate::db::{
index::{IndexId, key::codec::IndexKey},
key_taxonomy::{
COMPOSITE_PRIMARY_KEY_MAX_SIZE, INDEX_COMPONENT_MAX_SIZE, INDEX_KEY_MAX_SIZE,
INDEX_KEY_PREFIX_SIZE,
},
};
pub(super) const KEY_KIND_TAG_SIZE: usize = 1;
pub(super) const COMPONENT_COUNT_SIZE: usize = 1;
pub(super) const SEGMENT_LEN_SIZE: usize = 2;
pub(super) const INDEX_ID_SIZE: usize = IndexId::STORED_SIZE_USIZE;
pub(super) const KEY_PREFIX_SIZE: usize = INDEX_KEY_PREFIX_SIZE;
#[expect(clippy::cast_possible_truncation)]
impl IndexKey {
pub(crate) const MAX_COMPONENT_SIZE: usize = INDEX_COMPONENT_MAX_SIZE;
pub(crate) const MAX_PK_SIZE: usize = COMPOSITE_PRIMARY_KEY_MAX_SIZE;
const MIN_SEGMENT_SIZE: usize = 1;
pub(crate) const MAX_STORED_SIZE_BYTES: u64 = INDEX_KEY_MAX_SIZE as u64;
pub(crate) const MAX_STORED_SIZE_USIZE: usize = Self::MAX_STORED_SIZE_BYTES as usize;
pub(crate) const MIN_STORED_SIZE_BYTES: u64 =
(KEY_PREFIX_SIZE + SEGMENT_LEN_SIZE + Self::MIN_SEGMENT_SIZE) as u64;
pub(crate) const MIN_STORED_SIZE_USIZE: usize = Self::MIN_STORED_SIZE_BYTES as usize;
#[must_use]
pub(crate) fn wildcard_low_pk() -> Vec<u8> {
vec![0]
}
#[must_use]
pub(crate) fn wildcard_high_pk() -> Vec<u8> {
vec![0xFF]
}
}