A library for in-memory collections with flexible and composable indexes.
This crate provides a framework for building collections with multiple indexes that can be combined and composed. Key features include:
- Built-in indexes for common use cases (BTree, HashTable)
- Composable index combinators (grouping, filtering, mapping)
- Aggregation indexes for statistical operations
- Safe and efficient index maintenance as collection changes
Example
use ;
// A struct representing a person
// Create a collection indexed by age using premap
let mut collection = new;
// insert & update collection
let alice = collection.insert;
collection.insert;
collection.adjust_mut;
// ...
let q = collection.query;
// Query oldest person
let _youngest = q.0.max_one;
// Query the number of unique occupations
let _occupation_count = q.1.count_distinct;