Struct appendix::Index [−][src]
An index mapping keys to values
Methods
impl<K: Copy + PartialEq + Hash, V: Copy + Hash> Index<K, V>
[src]
impl<K: Copy + PartialEq + Hash, V: Copy + Hash> Index<K, V>
pub fn new<P: Into<PathBuf>>(path: P) -> Result<Self>
[src]
pub fn new<P: Into<PathBuf>>(path: P) -> Result<Self>
Construct a new Index
given a path
pub fn anonymous() -> Result<Self>
[src]
pub fn anonymous() -> Result<Self>
Construct a new in-memory Index
pub fn insert(&self, k: K, v: V) -> Result<AlreadyThere>
[src]
pub fn insert(&self, k: K, v: V) -> Result<AlreadyThere>
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]
pub fn get(&self, k: &K) -> Option<&V>
Get the value, if any, associated with key