Struct patricia_trie::sectriedb::SecTrieDB
[−]
[src]
pub struct SecTrieDB<'db> { /* fields omitted */ }
A Trie
implementation which hashes keys and uses a generic HashDB
backing database.
Use it as a Trie
trait object. You can use raw()
to get the backing TrieDB
object.
Methods
impl<'db> SecTrieDB<'db>
[src]
fn new(db: &'db HashDB, root: &'db H256) -> Result<Self>
[src]
Create a new trie with the backing database db
and empty root
Initialise to the state entailed by the genesis block. This guarantees the trie is built correctly. Returns an error if root does not exist.
fn raw(&self) -> &TrieDB
[src]
Get a reference to the underlying raw TrieDB
struct.
fn raw_mut(&mut self) -> &mut TrieDB<'db>
[src]
Get a mutable reference to the underlying raw TrieDB
struct.
Trait Implementations
impl<'db> Trie for SecTrieDB<'db>
[src]
fn iter<'a>(&'a self) -> Result<Box<TrieIterator<Item = TrieItem> + 'a>>
[src]
Returns a depth-first iterator over the elements of trie.
fn root(&self) -> &H256
[src]
Return the root of the trie.
fn contains(&self, key: &[u8]) -> Result<bool>
[src]
Does the trie contain a given key?
fn get_with<'a, 'key, Q: Query>(
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>> where
'a: 'key,
[src]
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>> where
'a: 'key,
Search for the key with the given query parameter. See the docs of the Query
trait for more details. Read more
fn is_empty(&self) -> bool
[src]
Is the trie empty?
fn get<'a, 'key>(&'a self, key: &'key [u8]) -> Result<Option<DBValue>> where
'a: 'key,
[src]
'a: 'key,
What is the value of the given key in this trie?