#[non_exhaustive]pub enum RecordSize {
Bits24,
Bits28,
Bits32,
}Expand description
Width, in bits, of a single child record inside a search-tree node.
Each node holds two records (a left and a right child). Wider records address larger trees at the cost of bytes on disk. The MMDB format defines exactly these three widths; any other width produces a file no reader will accept, so it is modeled as an enum rather than a raw integer.
A Writer picks the smallest size that fits by default — see
WriterBuilder::record_size to pin one explicitly.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bits24
24-bit records, 6-byte nodes. Capacity: ~16.7 million nodes.
Bits28
28-bit records, 7-byte nodes. Capacity: ~268 million nodes. Default.
Bits32
32-bit records, 8-byte nodes. Capacity: ~4.3 billion nodes.
Implementations§
Source§impl RecordSize
impl RecordSize
Sourcepub const fn node_bytes(self) -> usize
pub const fn node_bytes(self) -> usize
Number of bytes a single tree node (two records) occupies on disk.
Sourcepub const fn max_value(self) -> u64
pub const fn max_value(self) -> u64
Maximum addressable record value, exclusive. Values at or above this limit cannot be encoded and are caught before serialization.
Sourcepub const fn as_metadata(self) -> u16
pub const fn as_metadata(self) -> u16
Width encoded as a u16 for the metadata section’s record_size field.
Trait Implementations§
Source§impl Clone for RecordSize
impl Clone for RecordSize
Source§fn clone(&self) -> RecordSize
fn clone(&self) -> RecordSize
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more