Truncate entries from `index` onward (inclusive).
(&mut self, index: u64)
| 130 | |
| 131 | /// Truncate entries from `index` onward (inclusive). |
| 132 | fn truncate_from(&mut self, index: u64) { |
| 133 | if index <= self.snapshot_index { |
| 134 | return; |
| 135 | } |
| 136 | let offset = (index - self.snapshot_index - 1) as usize; |
| 137 | self.entries.truncate(offset); |
| 138 | let _ = self.storage.truncate(index); |
| 139 | } |
| 140 | |
| 141 | /// Apply a snapshot: discard all entries up to `last_included_index`. |
| 142 | pub fn apply_snapshot(&mut self, last_included_index: u64, last_included_term: u64) { |
no test coverage detected