pub mod page;
pub use page::{IndexPage, IndexPageType};
pub mod constants {
pub const PAGE_HEADER_SIZE: usize = 32;
pub const USABLE_SIZE: usize = 4096 - PAGE_HEADER_SIZE;
pub const MAX_KEYS: usize = 253;
pub const MAX_ENTRIES: usize = 254;
pub const MAX_CHILDREN: usize = MAX_KEYS + 1;
pub const KEY_SIZE: usize = 8;
pub const PAGE_ID_SIZE: usize = 8;
pub const ENTRY_SIZE: usize = KEY_SIZE + PAGE_ID_SIZE;
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_index_constants() {
assert_eq!(constants::PAGE_HEADER_SIZE, 32);
assert_eq!(constants::USABLE_SIZE, 4064);
assert_eq!(constants::MAX_KEYS, 253);
assert_eq!(constants::MAX_ENTRIES, 254);
assert_eq!(constants::MAX_CHILDREN, 254);
}
}