[−][src]Trait trie_db::HashDB
Trait modelling datastore keyed by a hash defined by the Hasher.
Required methods
fn keys(&self) -> HashMap<<H as Hasher>::Out, i32, RandomState>
Get the keys in the database together with number of underlying references.
fn get(&self, key: &<H as Hasher>::Out) -> Option<T>
Look up a given hash into the bytes that hash to it, returning None if the hash is not known.
fn contains(&self, key: &<H as Hasher>::Out) -> bool
Check for the existance of a hash-key.
fn insert(&mut self, value: &[u8]) -> <H as Hasher>::Out
Insert a datum item into the DB and return the datum's hash for a later lookup. Insertions
are counted and the equivalent number of remove()s must be performed before the data
is considered dead.
fn emplace(&mut self, key: <H as Hasher>::Out, value: T)
Like insert(), except you provide the key and the data is all moved.
fn remove(&mut self, key: &<H as Hasher>::Out)
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.
Trait Implementations
impl<'a, H, T> AsHashDB<H, T> for &'a mut (dyn HashDB<H, T> + 'a) where
H: Hasher, [src]
impl<'a, H, T> AsHashDB<H, T> for &'a mut (dyn HashDB<H, T> + 'a) where
H: Hasher, fn as_hash_db(&self) -> &dyn HashDB<H, T> | [src] |
fn as_hash_db_mut(&'b mut self) -> &'b mut (dyn HashDB<H, T> + 'b) | [src] |