use serde::{Serialize, Deserialize};
#[derive(Copy, Debug, Clone, Hash, Eq, PartialEq, Ord, PartialOrd, derive_more::Display, Serialize, Deserialize)]
pub struct RecordID(pub usize);
impl RecordID {
pub const NULL : RecordID = RecordID(usize::MAX);
}
impl RecordID {
pub fn from(id : usize) -> Self {
RecordID(id)
}
pub fn to_le_bytes(&self) -> [u8; 8] {
self.0.to_le_bytes()
}
}
#[derive(Serialize, Deserialize)]
pub struct RecordData {
pub key_groups : Vec<usize>,
}
impl RecordData {
pub fn new(key_groups : &[usize]) -> Self {
Self{
key_groups : key_groups.to_vec()
}
}
}