mintkv 0.1.0

A simple kv library based on btree
Documentation
use crate::errors::Error;

use super::constant::OpKind;

pub(crate) struct Encoder;

// Encoder[#TODO] (should add some comments)
impl Encoder {
    pub(super) fn encode(opkind: OpKind, data: &[u8]) -> Vec<u8> {
        let mut result = vec![0u8; data.len()];
        result[0] = opkind.as_u8();
        result[1..].clone_from_slice(data);
        result
    }

    fn decode(data: &[u8]) -> Result<(OpKind, &[u8]), Error> {
        todo!()
    }
}


// Encoder output format
// {indeices} {data}
// indices 用来标记key offset方便binary search