refactor: move iterator trait to parent mod
Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
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<()>;
|
||||
}
|
||||
@@ -6,7 +6,7 @@ use std::collections::BinaryHeap;
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
use super::impls::StorageIterator;
|
||||
use super::StorageIterator;
|
||||
|
||||
struct HeapWrapper<I: StorageIterator>(pub usize, pub Box<I>);
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
use super::impls::StorageIterator;
|
||||
use super::StorageIterator;
|
||||
|
||||
/// Merges two iterators of different types into one. If the two iterators have the same key, only
|
||||
/// produce the key once and prefer the entry from A.
|
||||
|
||||
Reference in New Issue
Block a user