2024-01-24 14:32:13 +08:00
|
|
|
pub mod concat_iterator;
|
2022-12-24 10:11:06 -05:00
|
|
|
pub mod merge_iterator;
|
|
|
|
|
pub mod two_merge_iterator;
|
|
|
|
|
|
2022-12-24 18:25:41 -05:00
|
|
|
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) -> anyhow::Result<()>;
|
|
|
|
|
|
2024-01-24 14:32:13 +08:00
|
|
|
/// Number of underlying active iterators for this iterator.
|
|
|
|
|
fn num_active_iterators(&self) -> usize {
|
|
|
|
|
1
|
|
|
|
|
}
|
|
|
|
|
}
|