disklru 0.3.3

DiskLRU is an experimental LRU store.
Documentation
// Copyright (C) 2024 Christian Mauduit <ufoot@ufoot.org>

//! [DiskLRU](https://gitlab.com/liberecofr/disklru) is an experimental LRU store implemented in [Rust](https://www.rust-lang.org/).
//!
//! It works as a simple key-value store and is powered by [sled](https://crates.io/crates/sled/)
//! which is _a lightweight pure-rust high-performance transactional embedded database_.
//!
//! It expires entries automatically passed a given number, following the LRU (least recently used) strategy,
//! which is a quite [common cache replacement policy]( https://en.wikipedia.org/wiki/Cache_replacement_policies).
//!
//! ![DiskLRU icon](https://gitlab.com/liberecofr/disklru/raw/main/disklru.png)
//!
//! # Examples
//!
//! ```
//! use disklru::Store;
//!
//! let mut store = Store::open_temporary(4).unwrap();
//! store.insert(&1, &10).unwrap();
//! store.insert(&2, &20).unwrap();
//! store.insert(&3, &30).unwrap();
//! store.insert(&4, &40).unwrap();
//! store.insert(&5, &50).unwrap();
//! // key1 has been dropped, size is limited to 4
//! assert_eq!(Some(2), store.lru().unwrap());
//! assert_eq!(Some(20), store.get(&2).unwrap());
//! // getting key2 has made key3 the least recently used item
//! assert_eq!(Some(3), store.lru().unwrap());
//! assert_eq!(Some(40), store.get(&4).unwrap());
//! // getting key4 makes it the most recently used item
//! assert_eq!("[3: 30, 5: 50, 2: 20, 4: 40]", format!("{}", store));
//! store.flush().unwrap(); // commit
//! ```

mod error;
mod iter;
mod serial;
mod store;
mod trans;

pub use error::*;
pub use iter::*;
pub use store::*;
pub mod sled {
    pub use sled::{Config, Mode};
}