39 lines
1000 B
Rust
39 lines
1000 B
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 super::impls::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.
|
||
|
|
pub struct TwoMergeIterator<A: StorageIterator, B: StorageIterator> {
|
||
|
|
a: A,
|
||
|
|
b: B,
|
||
|
|
// Add fields as need
|
||
|
|
}
|
||
|
|
|
||
|
|
impl<A: StorageIterator, B: StorageIterator> TwoMergeIterator<A, B> {
|
||
|
|
pub fn create(a: A, b: B) -> Result<Self> {
|
||
|
|
unimplemented!()
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
impl<A: StorageIterator, B: StorageIterator> StorageIterator for TwoMergeIterator<A, B> {
|
||
|
|
fn key(&self) -> &[u8] {
|
||
|
|
unimplemented!()
|
||
|
|
}
|
||
|
|
|
||
|
|
fn value(&self) -> &[u8] {
|
||
|
|
unimplemented!()
|
||
|
|
}
|
||
|
|
|
||
|
|
fn is_valid(&self) -> bool {
|
||
|
|
unimplemented!()
|
||
|
|
}
|
||
|
|
|
||
|
|
fn next(&mut self) -> Result<()> {
|
||
|
|
unimplemented!()
|
||
|
|
}
|
||
|
|
}
|