[][src]Struct trie_db::FatDB

pub struct FatDB<'db, H, C> where
    H: Hasher + 'db,
    C: NodeCodec<H>, 
{ /* fields omitted */ }

A Trie implementation which hashes keys and uses a generic HashDB backing database. Additionaly it stores inserted hash-key mappings for later retrieval.

Use it as a Trie or TrieMut trait object.

Methods

impl<'db, H, C> FatDB<'db, H, C> where
    H: Hasher,
    C: NodeCodec<H>, 
[src]

pub fn new(
    db: &'db dyn HashDBRef<H, DBValue>,
    root: &'db H::Out
) -> Result<Self, H::Out, C::Error>
[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.

pub fn db(&self) -> &dyn HashDBRef<H, DBValue>[src]

Get the backing database.

Trait Implementations

impl<'db, H, C> Trie<H, C> for FatDB<'db, H, C> where
    H: Hasher,
    C: NodeCodec<H>, 
[src]

fn is_empty(&self) -> bool[src]

Is the trie empty?

fn get<'a, 'key>(
    &'a self,
    key: &'key [u8]
) -> Result<Option<DBValue>, H::Out, C::Error> where
    'a: 'key, 
[src]

What is the value of the given key in this trie?

Auto Trait Implementations

impl<'db, H, C> !Send for FatDB<'db, H, C>

impl<'db, H, C> !Sync for FatDB<'db, H, C>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]