Trait trie_db::HashDBRef

source ·
pub trait HashDBRef<H, T>
where H: Hasher,
{ // Required methods fn get( &self, key: &<H as Hasher>::Out, prefix: (&[u8], Option<u8>), ) -> Option<T>; fn contains( &self, key: &<H as Hasher>::Out, prefix: (&[u8], Option<u8>), ) -> bool; }
Expand description

Trait for immutable reference of HashDB.

Required Methods§

source

fn get( &self, key: &<H as Hasher>::Out, prefix: (&[u8], Option<u8>), ) -> Option<T>

Look up a given hash into the bytes that hash to it, returning None if the hash is not known.

source

fn contains( &self, key: &<H as Hasher>::Out, prefix: (&[u8], Option<u8>), ) -> bool

Check for the existance of a hash-key.

Implementors§

source§

impl<'a, H, T> HashDBRef<H, T> for &'a dyn HashDB<H, T>
where H: Hasher,

source§

impl<'a, H, T> HashDBRef<H, T> for &'a mut dyn HashDB<H, T>
where H: Hasher,

impl<H, KF, T> HashDBRef<H, T> for MemoryDB<H, KF, T>
where H: KeyHasher, T: Default + PartialEq<T> + AsRef<[u8]> + for<'a> From<&'a [u8]> + Clone + Send + Sync, KF: KeyFunction<H> + Send + Sync,

impl<'a, DB, H, T> HashDBRef<H, T> for KeySpacedDB<'a, DB, H>
where DB: HashDBRef<H, T> + ?Sized, H: Hasher, T: From<&'static [u8]>,