diff options
author | Determinant <[email protected]> | 2020-06-10 20:33:46 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2020-06-10 20:33:46 -0400 |
commit | ee0767924a8cff8d9926c245f6edefeb36b573c2 (patch) | |
tree | 6ab1edf8b6f3c101167a353518626e691aff1e95 /src/wal.rs | |
parent | e7e665da7f7d6a111446b34a673d443214b1aac1 (diff) |
...
Diffstat (limited to 'src/wal.rs')
-rw-r--r-- | src/wal.rs | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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)) |