Skip to main content

ic_storage/
lib.rs

1#![doc = include_str!("../README.md")]
2
3//! Independent stable-memory B-trees with caller-owned key ordering.
4//!
5//! Collections require allocation-governed `ic-memory` runtime handles.
6//! The private engine remains generic for substrate and fault-injection tests.
7//! See the package README for persistence and failure boundaries.
8
9pub mod adapter;
10mod btree;
11
12use ic_memory::RuntimeMemory;
13use ic_stable_structures as substrate;
14use substrate::{DefaultMemoryImpl, Memory};
15
16pub use btree::{Comparator, Config, Error, Lexicographic};
17
18mod governed;
19pub use governed::BTreeMap;
20/// A lazy entry borrowed from a governed tree.
21pub type Entry<'a, M = DefaultMemoryImpl, C = Lexicographic> =
22    btree::Entry<'a, RuntimeMemory<M>, C>;
23/// A bidirectional range borrowed from a governed tree.
24pub type Range<'a, M = DefaultMemoryImpl, C = Lexicographic> =
25    btree::Range<'a, RuntimeMemory<M>, C>;