pub use atom_file::Data;
use std::sync::Arc;
pub trait Key {
fn hash(&self) -> u64;
fn equal(&self, r: u64) -> bool;
}
pub mod hashmap;
pub use hashmap::*;
pub mod pageset;
pub use pageset::*;
pub mod table;
pub use table::*;
pub mod varval;
pub use varval::*;
mod pagetree;
use pagetree::*;
mod treevec;
use treevec::*;
mod bucket;
const PAGE_SIZE: u64 = 4612;
#[test]
fn test() {
use page_store::*;
let limits = Limits::default();
let file = atom_file::MultiFileStorage::new("test.db");
let upd = atom_file::FastFileStorage::new("test.upd");
let af = atom_file::AtomicFile::new_with_limits(file, upd, &limits.af_lim);
let ps = BlockPageStg::new(af, &limits);
let is_new = ps.is_new();
let spd = SharedPagedData::new_from_ps(ps);
println!("max page size={}", spd.psi.max_size_page());
let mut ps = PageSet::new(spd.new_writer());
if false {
let (root, len) = if is_new { (ps.new_page(), 0) } else { (3, 410) };
test_tv(root, len, &mut ps);
}
if false {
println!("Calling test_hash");
hashmap::test_hash(&mut ps);
}
if false {
test_table(&mut ps);
}
test_varval(&mut ps);
spd.shutdown();
}
#[cfg(test)]
fn tos(s: &[u8]) -> &str {
str::from_utf8(s).unwrap()
}
pub enum DataType {
Named(u64),
Struct(Vec<(String, DataType)>),
Tuple(Vec<DataType>),
Enum(Vec<(String, DataType)>),
String(u8),
Binary(u8),
Int(u8),
Array(usize, Box<DataType>),
List(Box<DataType>),
Map(Box<DataType>, Box<DataType>),
}
impl DataType {}