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

Method last_term

nodedb-raft/src/log.rs:51–56  ·  view source on GitHub ↗

Last log term.

(&self)

Source from the content-addressed store, hash-verified

49
50 /// Last log term.
51 pub fn last_term(&self) -> u64 {
52 self.entries
53 .last()
54 .map(|e| e.term)
55 .unwrap_or(self.snapshot_term)
56 }
57
58 /// Get the term at a given index.
59 pub fn term_at(&self, index: u64) -> Option<u64> {

Callers 2

start_electionMethod · 0.80
handle_request_voteMethod · 0.80

Calls 1

lastMethod · 0.45

Tested by

no test coverage detected