Return committed log entries in the inclusive range `[lo, hi]`. Clamps `hi` to `commit_index` so callers that pass `u64::MAX` never read uncommitted entries. Returns `Err(RaftError::LogCompacted)` if `lo` has already been compacted into a snapshot.
(
&self,
lo: u64,
hi: u64,
)
| 175 | /// read uncommitted entries. Returns `Err(RaftError::LogCompacted)` if |
| 176 | /// `lo` has already been compacted into a snapshot. |
| 177 | pub fn log_entries_range( |
| 178 | &self, |
| 179 | lo: u64, |
| 180 | hi: u64, |
| 181 | ) -> crate::error::Result<&[crate::message::LogEntry]> { |
| 182 | let hi = hi.min(self.volatile.commit_index); |
| 183 | self.log.entries_range(lo, hi) |
| 184 | } |
| 185 | |
| 186 | /// Current voter peer list (excluding self). |
| 187 | pub fn peers(&self) -> &[u64] { |
no test coverage detected