Function sp_database::with_lookup [−][src]
pub fn with_lookup<R, H: Clone>(
db: &dyn Database<H>,
hash: &H,
mut f: impl FnMut(&[u8]) -> R
) -> Option<R>
Call f
with the preimage stored for hash
and return the result, or None
if no preimage
is currently stored.
This may be faster than lookup
since it doesn't allocate.