summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wal.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wal.rs b/src/wal.rs
index 1cbe8c1..dd41045 100644
--- a/src/wal.rs
+++ b/src/wal.rs
@@ -22,12 +22,17 @@ pub type WALBytes = Box<[u8]>;
pub type WALFileId = u64;
pub type WALPos = u64;
-#[derive(Eq, PartialEq, Copy, Clone, Debug)]
+#[derive(Eq, PartialEq, Copy, Clone, Debug, Hash)]
pub struct WALRingId {
start: WALPos,
end: WALPos
}
+impl WALRingId {
+ pub fn get_start(&self) -> WALPos { self.start }
+ pub fn get_end(&self) -> WALPos { self.end }
+}
+
impl Ord for WALRingId {
fn cmp(&self, other: &WALRingId) -> std::cmp::Ordering {
other.start.cmp(&self.start).then_with(|| other.end.cmp(&self.end))