Get entry at a given index.
(&self, index: u64)
| 71 | |
| 72 | /// Get entry at a given index. |
| 73 | pub fn entry_at(&self, index: u64) -> Option<&LogEntry> { |
| 74 | if index <= self.snapshot_index || index > self.last_index() { |
| 75 | return None; |
| 76 | } |
| 77 | let offset = (index - self.snapshot_index - 1) as usize; |
| 78 | self.entries.get(offset) |
| 79 | } |
| 80 | |
| 81 | /// Get entries in range [lo, hi] inclusive. |
| 82 | pub fn entries_range(&self, lo: u64, hi: u64) -> Result<&[LogEntry]> { |
no test coverage detected