1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! High-performance, read-optimized key-value maps persisted to massmap files.
//!
//! The `massmap` crate provides utilities for building and querying immutable hash
//! maps that can be memory-mapped or streamed from disk with minimal overhead.
//! Builders take sorted or unsorted key-value iterators and produce a binary
//! representation that can be shared between processes, while readers offer
//! constant-time lookups backed by zero-copy IO traits.
//!
//! Typical usage involves serializing an iterator with [`MassMapBuilder`] and
//! opening the resulting file with [`MassMap`] to perform single or batched
//! lookups.
//!
//! ```
//! use massmap::{MassMap, MassMapBuilder};
//!
//! # fn main() -> std::io::Result<()> {
//! let entries = [
//! ("apple".to_string(), 1u32),
//! ("banana".to_string(), 2u32),
//! ];
//! let file = std::fs::File::create("examples/fruits.massmap")?;
//! MassMapBuilder::default().build(&file, entries.iter())?;
//!
//! let file = std::fs::File::open("examples/fruits.massmap")?;
//! let map = MassMap::<String, u32, _>::load(file)?;
//! assert_eq!(map.get("banana")?, Some(2));
//! # Ok(())
//! # }
//! ```
const MAGIC_NUMBER: u64 = u64from_be_bytes;
pub use ;
pub use ;
pub use MassMapReader;
pub use MassMapWriter;
pub use ;
pub use ;