You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KeyValuePair trait allows customization of key and value, so it's still lazily loaded. And key and value methods will not have to check for valid any more. Iterator doesn't have to store the error either.
This interface is for future refactor, doesn't have to be implemented in this PR.
Maybe the seek should be fn seek(&mut self, key: &[u8]) -> Result<()> ?
And it seems strange to return KeyValuePair in every next, seek and rewind. IMO, only current need to yield out the entry, which meets the "lazy loading" requirements.
The iterator trait can panic due to incorrect usage. I propose a safer design:
KeyValuePair
trait allows customization of key and value, so it's still lazily loaded. Andkey
andvalue
methods will not have to check for valid any more. Iterator doesn't have to store the error either.This interface is for future refactor, doesn't have to be implemented in this PR.
Originally posted by @BusyJay in #30 (comment)
The text was updated successfully, but these errors were encountered: