checkpoint

This commit is contained in:
John Smith
2022-07-03 15:52:27 -04:00
parent 6d1198cd92
commit b010c8a61f
17 changed files with 940 additions and 90 deletions

View File

@@ -281,6 +281,24 @@ impl ValueKey {
}
}
#[derive(Clone, Debug, Default, PartialOrd, PartialEq, Eq, Ord, Serialize, Deserialize)]
pub struct ValueData {
pub data: Vec<u8>,
pub seq: u32,
}
impl ValueData {
pub fn new(data: Vec<u8>) -> Self {
Self { data, seq: 0 }
}
pub fn new_with_seq(data: Vec<u8>, seq: u32) -> Self {
Self { data, seq }
}
pub fn change(&mut self, data: Vec<u8>) {
self.data = data;
self.seq += 1;
}
}
#[derive(Clone, Debug, Default, PartialOrd, PartialEq, Eq, Ord, Serialize, Deserialize)]
pub struct BlockId {
pub key: DHTKey,