pub struct SecTrieDB<'db, L> where
L: TrieLayout, { /* private fields */ }
Expand description
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.
Implementations
sourceimpl<'db, L> SecTrieDB<'db, L> where
L: TrieLayout,
impl<'db, L> SecTrieDB<'db, L> where
L: TrieLayout,
sourcepub fn new(
db: &'db dyn HashDBRef<L::Hash, DBValue>,
root: &'db TrieHash<L>
) -> Result<Self, TrieHash<L>, CError<L>>
pub fn new(
db: &'db dyn HashDBRef<L::Hash, DBValue>,
root: &'db TrieHash<L>
) -> Result<Self, TrieHash<L>, CError<L>>
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.
Trait Implementations
sourceimpl<'db, L> Trie<L> for SecTrieDB<'db, L> where
L: TrieLayout,
impl<'db, L> Trie<L> for SecTrieDB<'db, L> where
L: TrieLayout,
sourcefn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>>
fn contains(&self, key: &[u8]) -> Result<bool, TrieHash<L>, CError<L>>
Does the trie contain a given key?
sourcefn get_with<'a, 'key, Q: Query<L::Hash>>(
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>> where
'a: 'key,
fn get_with<'a, 'key, Q: Query<L::Hash>>(
&'a self,
key: &'key [u8],
query: Q
) -> Result<Option<Q::Item>, TrieHash<L>, CError<L>> where
'a: 'key,
Search for the key with the given query parameter. See the docs of the Query
trait for more details. Read more
Auto Trait Implementations
impl<'db, L> !RefUnwindSafe for SecTrieDB<'db, L>
impl<'db, L> !Send for SecTrieDB<'db, L>
impl<'db, L> !Sync for SecTrieDB<'db, L>
impl<'db, L> Unpin for SecTrieDB<'db, L>
impl<'db, L> !UnwindSafe for SecTrieDB<'db, L>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more