57 lines
1.1 KiB
Rust
57 lines
1.1 KiB
Rust
#![allow(unused_variables)] // TODO(you): remove this lint after implementing this mod
|
|
#![allow(dead_code)] // TODO(you): remove this lint after implementing this mod
|
|
|
|
use anyhow::Result;
|
|
|
|
use crate::iterators::impls::StorageIterator;
|
|
|
|
pub struct LsmIterator {}
|
|
|
|
impl StorageIterator for LsmIterator {
|
|
fn is_valid(&self) -> bool {
|
|
unimplemented!()
|
|
}
|
|
|
|
fn key(&self) -> &[u8] {
|
|
unimplemented!()
|
|
}
|
|
|
|
fn value(&self) -> &[u8] {
|
|
unimplemented!()
|
|
}
|
|
|
|
fn next(&mut self) -> Result<()> {
|
|
unimplemented!()
|
|
}
|
|
}
|
|
|
|
/// A wrapper around existing iterator, will prevent users from calling `next` when the iterator is
|
|
/// invalid.
|
|
pub struct FusedIterator<I: StorageIterator> {
|
|
iter: I,
|
|
}
|
|
|
|
impl<I: StorageIterator> FusedIterator<I> {
|
|
pub fn new(iter: I) -> Self {
|
|
Self { iter }
|
|
}
|
|
}
|
|
|
|
impl<I: StorageIterator> StorageIterator for FusedIterator<I> {
|
|
fn is_valid(&self) -> bool {
|
|
unimplemented!()
|
|
}
|
|
|
|
fn key(&self) -> &[u8] {
|
|
unimplemented!()
|
|
}
|
|
|
|
fn value(&self) -> &[u8] {
|
|
unimplemented!()
|
|
}
|
|
|
|
fn next(&mut self) -> Result<()> {
|
|
unimplemented!()
|
|
}
|
|
}
|