pub trait Store<K: ?Sized, V: ?Sized>: Sized {
// Required methods
fn lm_len(&self) -> usize;
fn lm_get(&self, index: usize) -> Option<(&K, &V)>;
fn lm_binary_search_by<F>(&self, cmp: F) -> Result<usize, usize>
where F: FnMut(&K) -> Ordering;
// Provided methods
fn lm_is_empty(&self) -> bool { ... }
fn lm_last(&self) -> Option<(&K, &V)> { ... }
}
Expand description
Trait to enable pluggable backends for LiteMap.
Some methods have default implementations provided for convenience; however, it is generally better to implement all methods that your data store supports.
Required Methods§
Provided Methods§
Sourcefn lm_is_empty(&self) -> bool
fn lm_is_empty(&self) -> bool
Returns whether the store is empty (contains 0 elements).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.