There should be two more functions, get_all and get_all_with_proofs:
fn get_all(&self, version: Version, impl Iterator<Item = KeyHash>) -> GetAll { /* ... */ }
fn get_all_with_proofs(&self, version: Version, impl Iterator<Item = KeyHash>) -> GetAllWithProofs { /* ... */ }
Where GetAll and GetAllWithProofs are types that impl Iterator<Item = (KeyHash, Option<OwnedValue>)> and impl Iterator<Item = (KeyHash, Option<(OwnedValue, SparseMerkleProof)>)>, respectively, plus a variety of other iterator-related traits.
These methods would share the TreeCache for the duration of iteration, making it so that lookups from the database are not repeated. This is especially going to be useful to support range lookups based on our auxiliary key to key hash index, where we could feed the iterator resulting from a range query directly into this method, and get constant-space iteration over a key hash preimage range.
There should be two more functions,
get_allandget_all_with_proofs:Where
GetAllandGetAllWithProofsare types thatimpl Iterator<Item = (KeyHash, Option<OwnedValue>)>andimpl Iterator<Item = (KeyHash, Option<(OwnedValue, SparseMerkleProof)>)>, respectively, plus a variety of other iterator-related traits.These methods would share the
TreeCachefor the duration of iteration, making it so that lookups from the database are not repeated. This is especially going to be useful to support range lookups based on our auxiliary key to key hash index, where we could feed the iterator resulting from a range query directly into this method, and get constant-space iteration over a key hash preimage range.