feat(docs): finish part 1

Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
Alex Chi
2022-12-23 23:45:09 -05:00
parent 9f3e29c781
commit a03cb765ff
7 changed files with 146 additions and 4 deletions

View File

@@ -10,7 +10,10 @@ pub use builder::BlockBuilder;
pub use iterator::BlockIterator;
/// A block is the smallest unit of read and caching in LSM tree. It is a collection of sorted key-value pairs.
pub struct Block {}
pub struct Block {
data: Vec<u8>,
offsets: Vec<u16>,
}
impl Block {
pub fn encode(&self) -> Bytes {

View File

@@ -25,7 +25,7 @@ impl BlockMeta {
/// Encode block meta to a buffer.
pub fn encode_block_meta(
block_meta: &[BlockMeta],
#[allow(clippy::ptr_arg)] buf: &mut Vec<u8>,
#[allow(clippy::ptr_arg)] /* remove this allow after you finish */ buf: &mut Vec<u8>,
) {
unimplemented!()
}