Struct idx::Idx
[−]
[src]
pub struct Idx<K: Copy + PartialEq + Hash, V: Copy + Hash> { /* fields omitted */ }
An index mapping keys to values
Methods
impl<K: Copy + PartialEq + Hash, V: Copy + Hash> Idx<K, V>
[src]
pub fn new<P: Into<PathBuf>>(path: P) -> Result<Self>
[src]
Construct a new Idx
given a path
pub fn anonymous() -> Result<Self>
[src]
Construct a new in-memory Idx
pub fn insert(&self, k: K, v: V) -> Result<()>
[src]
Insert a new key-value pair into the index, if the key is already there, this is a no-op.
pub fn get(&self, k: &K) -> Option<&V>
[src]
Get the value, if any, associated with key