pub fn record_all_keys<H: Hasher, DB>(
	db: &DB,
	root: &H::Out,
	recorder: &mut Recorder<H::Out>
) -> Result<(), Box<TrieError<H::Out>>> where
	DB: hash_db::HashDBRef<H, trie_db::DBValue>
{
	let trie = TrieDB::<H>::new(&*db, root)?;
	let iter = trie.iter()?;

	for x in iter {
		let (key, _) = x?;

		// there's currently no API like iter_with()
		// => use iter to enumerate all keys AND lookup each
		// key using get_with
		trie.get_with(&key, &mut *recorder)?;
	}

	Ok(())
}
/// Record all keys for a given root.
Record all keys for a given root.
Record all keys for a given root .
pub fn record_all_keys<H: Hasher, DB>(
	db: &DB,
	root: &H::Out,
	recorder: &mut Recorder<H::Out>
) -> Result<(), Box<TrieError<H::Out>>> where
	DB: hash_db::HashDBRef<H, trie_db::DBValue>
{
	let trie = TrieDB::<H>::new(&*db, root)?;
	let iter = trie.iter()?;
	for x in iter {
		let (key, _) = x?;
		// there's currently no API like iter_with()
		// => use iter to enumerate all keys AND lookup each
		// key using get_with
		trie.get_with(&key, &mut *recorder)?;
	}
	Ok(())
}
pub fn record_all_keys < H : Hasher , DB > ( db : & DB , root : & H :: Out , recorder : & mut Recorder < H :: Out > ) -> Result < ( ) , Box < TrieError < H :: Out > > > where DB : hash_db :: HashDBRef < H , trie_db :: DBValue > { let trie = TrieDB :: < H > :: new ( & * db , root ) ? ; let iter = trie . iter ( ) ? ; for x in iter { let ( key , _ ) = x ? ; // there's currently no API like iter_with() // => use iter to enumerate all keys AND lookup each // key using get_with trie . get_with ( & key , & mut * recorder ) ? ; } Ok ( ( ) ) }
Record all keys for a given root.
Record all keys for a given root .
db
&DB
root
&H::Out
recorder
&mut Recorder<H::Out>
db
&DB
root
&H::Out
recorder
&mut Recorder<H::Out>