Change entry header. Expand api
This commit is contained in:
parent
2f23df1009
commit
cac34d95e0
6 changed files with 150 additions and 39 deletions
|
|
@ -7,6 +7,7 @@ use std::path::Path;
|
|||
mod storage_engine;
|
||||
mod binary_coding;
|
||||
mod error;
|
||||
mod index;
|
||||
|
||||
use crate::storage_engine::*;
|
||||
|
||||
|
|
@ -17,7 +18,7 @@ const TABLE_PATH: &'static str = "test_table";
|
|||
type Result<T> = std::result::Result<T, std::io::Error>;
|
||||
|
||||
async fn create_store() -> Result<Store<Data>> {
|
||||
let mut store: Store<Data> = Store::new(TABLE_PATH, 5).await.map_err(|e| e.to_io_or_panic())?;
|
||||
let mut store: Store<Data> = Store::new(TABLE_PATH, 5, 0).await.map_err(|e| e.to_io_or_panic())?;
|
||||
println!("CREATED");
|
||||
println!("{:?}", store.read_all_bytes().await?);
|
||||
|
||||
|
|
@ -77,7 +78,7 @@ async fn main() -> Result<()> {
|
|||
// let entry0: Entry<u32> = Entry::new(vec![99, 98, 97, 96, 95]);
|
||||
// append_entry(&mut store, &entry0).await?;
|
||||
|
||||
store.read_entries(3).await.map_err(|e| e.to_io_or_panic())?;
|
||||
store.read_entries(2).await.map_err(|e| e.to_io_or_panic())?;
|
||||
|
||||
|
||||
// let entry2: StoreEntry<u32> = StoreEntry::new_deleted(vec![3, 2, 1]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue