more comments, sync check

Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
Alex Chi
2022-12-23 22:32:30 -05:00
parent 72cee6ac13
commit 3c50c81b69
20 changed files with 298 additions and 46 deletions

View File

@@ -5,57 +5,60 @@ use std::sync::Arc;
use super::Block;
pub struct BlockIterator {}
/// Iterates on a block.
pub struct BlockIterator {
block: Arc<Block>,
key: Vec<u8>,
value: Vec<u8>,
idx: usize,
}
impl BlockIterator {
fn new(block: Arc<Block>) -> Self {
unimplemented!()
Self {
block,
key: Vec::new(),
value: Vec::new(),
idx: 0,
}
}
/// Creates a block iterator and seek to the first entry.
pub fn create_and_seek_to_first(block: Arc<Block>) -> Self {
unimplemented!()
}
/// Creates a block iterator and seek to the first key that >= `key`.
pub fn create_and_seek_to_key(block: Arc<Block>, key: &[u8]) -> Self {
unimplemented!()
}
/// Returns the key of the current entry.
pub fn key(&self) -> &[u8] {
unimplemented!()
}
/// Returns the value of the current entry.
pub fn value(&self) -> &[u8] {
unimplemented!()
}
/// Returns true if the iterator is valid.
pub fn is_valid(&self) -> bool {
unimplemented!()
}
/// Seeks to the first key in the block.
pub fn seek_to_first(&mut self) {
unimplemented!()
}
pub fn seek_to_last(&mut self) {
unimplemented!()
}
pub fn len(&self) -> usize {
unimplemented!()
}
pub fn is_empty(&self) -> bool {
unimplemented!()
}
pub fn seek_to(&mut self, idx: usize) {
unimplemented!()
}
/// Move to the next key in the block.
pub fn next(&mut self) {
unimplemented!()
}
/// Seek to the first key that >= `key`.
pub fn seek_to_key(&mut self, key: &[u8]) {
unimplemented!()
}