MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / log_entries_range

Method log_entries_range

nodedb-raft/src/node/core.rs:177–184  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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] {

Callers 1

Calls 1

entries_rangeMethod · 0.80

Tested by

no test coverage detected