mappy_core/
lib.rs

1//! # Mappy Core
2//! 
3//! Core implementation of maplet data structures for space-efficient approximate key-value mappings.
4//! 
5//! Based on the research paper "Time To Replace Your Filter: How Maplets Simplify System Design"
6//! by Bender, Conway, Farach-Colton, Johnson, and Pandey.
7
8pub mod maplet;
9pub mod hash;
10pub mod quotient_filter;
11pub mod operators;
12pub mod deletion;
13pub mod resize;
14pub mod encoding;
15pub mod error;
16pub mod layout;
17pub mod concurrent;
18pub mod types;
19pub mod storage;
20pub mod engine;
21pub mod ttl;
22
23// Re-export main types
24pub use maplet::Maplet;
25pub use operators::{CounterOperator, SetOperator, MaxOperator, MinOperator, MergeOperator, VectorOperator, VectorConcatOperator, CustomOperator};
26pub use types::{MapletStats, MapletError, MapletResult};
27pub use engine::{Engine, EngineConfig, EngineStats};
28pub use storage::{Storage, StorageStats, StorageConfig, PersistenceMode};
29pub use ttl::{TTLManager, TTLConfig, TTLStats, TTLEntry};
30
31/// Common result type for maplet operations
32pub type Result<T> = std::result::Result<T, MapletError>;
33
34#[cfg(test)]
35mod tests {
36    use super::*;
37
38    #[tokio::test]
39    async fn test_basic_maplet_creation() {
40        let maplet = Maplet::<String, u64, CounterOperator>::new(100, 0.01).unwrap();
41        assert_eq!(maplet.len().await, 0);
42        assert!(maplet.error_rate() <= 0.01);
43    }
44}