pub struct PreVoteReply {
pub term: Term,
pub vote_granted: bool,
pub from: NodeId,
}Expand description
A peer’s response to a PreVote.
term is the responder’s current term, unchanged by the pre-vote. If it
exceeds the pre-candidate’s term, the pre-candidate has fallen behind and
abandons the round; otherwise vote_granted tells it whether this peer would
support a real election. None of this touches persistent state.
§Examples
use raft_io::PreVoteReply;
let reply = PreVoteReply { term: 4, vote_granted: true, from: 3 };
assert!(reply.vote_granted);Fields§
§term: TermThe responder’s current term, unchanged by the pre-vote.
vote_granted: boolWhether the responder would grant a real vote under these conditions.
from: NodeIdThe node that produced this reply.
Trait Implementations§
Source§impl Clone for PreVoteReply
impl Clone for PreVoteReply
Source§fn clone(&self) -> PreVoteReply
fn clone(&self) -> PreVoteReply
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PreVoteReply
impl Debug for PreVoteReply
Source§impl Deserialize for PreVoteReply
impl Deserialize for PreVoteReply
impl Eq for PreVoteReply
Source§impl PartialEq for PreVoteReply
impl PartialEq for PreVoteReply
Source§fn eq(&self, other: &PreVoteReply) -> bool
fn eq(&self, other: &PreVoteReply) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PreVoteReply
impl Serialize for PreVoteReply
impl StructuralPartialEq for PreVoteReply
Auto Trait Implementations§
impl Freeze for PreVoteReply
impl RefUnwindSafe for PreVoteReply
impl Send for PreVoteReply
impl Sync for PreVoteReply
impl Unpin for PreVoteReply
impl UnsafeUnpin for PreVoteReply
impl UnwindSafe for PreVoteReply
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more