Files
mini_lsm/mini-lsm/src/iterators/impls.rs
Alex Chi 4eb2177a3e feat(code): part 3 iterators
Signed-off-by: Alex Chi <iskyzh@gmail.com>
2022-12-24 10:11:06 -05:00

16 lines
325 B
Rust

use anyhow::Result;
pub trait StorageIterator {
/// Get the current value.
fn value(&self) -> &[u8];
/// Get the current key.
fn key(&self) -> &[u8];
/// Check if the current iterator is valid.
fn is_valid(&self) -> bool;
/// Move to the next position.
fn next(&mut self) -> Result<()>;
}