aurora 0.0.5

A lightweight and extensible data storage library in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// Core trait for storage backends, allowing different implementations
pub trait Storage<K, V> {
    fn get(&self, key: &K) -> Option<V>;
    fn insert(&mut self, key: K, value: V) -> Option<V>;
    fn remove(&mut self, key: &K) -> Option<V>;
    fn contains_key(&self, key: &K) -> bool;
    fn clear(&mut self);
    fn len(&self) -> usize;
    fn is_empty(&self) -> bool;
    fn keys(&self) -> Vec<K>
    where
        K: Clone;
    fn search_by_value<F>(&self, predicate: F) -> Vec<K>
    where
        F: Fn(&V) -> bool,
        K: Clone;
}