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
49
50
51
52
53
54
55
56
57
58
59
// Copyright 2026 Mahmoud Harmouch.
//
// Licensed under the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! # frozndict
//!
//! A memory-efficient, fully immutable dictionary for Python, powered by Rust.
//!
//! ## Overview
//!
//! `frozndict` provides a zero-overhead, hashable, immutable mapping type that
//! can be used wherever a frozen alternative to Python's built-in `dict` is
//! needed.
//!
//! The core data structure, [`frozen_map::FrozenMap`], stores entries in a
//! single sorted heap allocation. Lookups run in O(log n) via binary search;
//! the hash is computed once at construction and cached, making repeated
//! `hash()` calls O(1).
//!
//! The Python class [`python::FrozenDict`] wraps [`frozen_map::FrozenMap`] and
//! is exposed to Python as the `FrozenDict` (and its `frozendict` alias) type.
//!
//! ## Modules
//!
//! - [`frozen_map`] - The core Rust data structure.
//! - [`python`] - PyO3 Python bindings (gated on the `python` feature flag).
use *;
/// Entry point for the `_frozndict` Python extension module.
///
/// This function is called by Python's import machinery when the compiled
/// extension is imported. It registers the [`python::FrozenDict`] class and
/// sets the module version string.
// Copyright 2026 Mahmoud Harmouch.
//
// Licensed under the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.