pub trait LastVoteStore {
// Required methods
fn load(&self) -> Result<LastVote, LastVoteError>;
fn persist(&self, vote: &LastVote) -> Result<(), LastVoteError>;
}Expand description
Durable store for a node’s last vote. The contract is narrow on purpose:
load returns the persisted record (or the default term 0, voted_for None when nothing was ever written), and persist makes a record
durable before the caller acknowledges a grant.
Required Methods§
fn load(&self) -> Result<LastVote, LastVoteError>
fn persist(&self, vote: &LastVote) -> Result<(), LastVoteError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".