pub fn with_lookup<R, H: Clone>(
    db: &dyn Database<H>,
    hash: &H,
    f: impl FnMut(&[u8]) -> R
) -> Option<R>
Expand description

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.