Trait hash_db::PlainDB [−][src]
Trait modelling a plain datastore whose key is a fixed type. The caller should ensure that a key only corresponds to one value.
Required methods
fn get(&self, key: &K) -> Option<V>
[src]
Look up a given hash into the bytes that hash to it, returning None if the hash is not known.
fn contains(&self, key: &K) -> bool
[src]
Check for the existance of a hash-key.
fn emplace(&mut self, key: K, value: V)
[src]
Insert a datum item into the DB. Insertions are counted and the equivalent
number of remove()
s must be performed before the data is considered dead.
The caller should ensure that a key only corresponds to one value.
fn remove(&mut self, key: &K)
[src]
Remove a datum previously inserted. Insertions can be “owed” such that the
same number of insert()
s may happen without the data being eventually
being inserted into the DB. It can be “owed” more than once.
The caller should ensure that a key only corresponds to one value.