bindb/storage/fixed/header.rs
1use binbuf::BytesPtr;
2use std::marker::PhantomData;
3
4binbuf::fixed! {
5 #[derive(Clone, Debug)]
6 pub struct Value {
7 #[lens(pub buf_next_entry_id)]
8 pub next_entry_id: u64,
9 }
10
11 buf! { pub struct Buf<P>(Value, P); }
12
13 impl I for Value {
14 type Buf<P> = Buf<P>;
15 }
16
17 impl Code for Value {}
18}
19
20impl<P: BytesPtr> Buf<P> {
21 pub fn next_entry_id(self) -> binbuf::Buf<u64, P> {
22 Value::buf_next_entry_id(self)
23 }
24}
25
26// impl<E, M> Value<E, M> {
27// pub fn new(next_entry_id: u64, meta: M) -> Self {
28// Self { next_entry_id, meta, _marker: PhantomData }
29// }
30// }