pub struct RequestVoteReply {
pub term: Term,
pub vote_granted: bool,
pub from: NodeId,
}Expand description
A peer’s response to a RequestVote.
from names the responder so the candidate can count distinct votes without
depending on transport-level addressing. If term exceeds the candidate’s
term, the candidate steps down instead of counting the vote.
§Examples
use raft_io::RequestVoteReply;
let reply = RequestVoteReply { term: 4, vote_granted: true, from: 3 };
assert!(reply.vote_granted);Fields§
§term: TermThe responder’s current term, for the candidate to update itself.
vote_granted: boolWhether the responder granted its vote.
from: NodeIdThe node that produced this reply.
Trait Implementations§
Source§impl Clone for RequestVoteReply
impl Clone for RequestVoteReply
Source§fn clone(&self) -> RequestVoteReply
fn clone(&self) -> RequestVoteReply
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 RequestVoteReply
impl Debug for RequestVoteReply
Source§impl Deserialize for RequestVoteReply
impl Deserialize for RequestVoteReply
impl Eq for RequestVoteReply
Source§impl PartialEq for RequestVoteReply
impl PartialEq for RequestVoteReply
Source§fn eq(&self, other: &RequestVoteReply) -> bool
fn eq(&self, other: &RequestVoteReply) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for RequestVoteReply
impl Serialize for RequestVoteReply
impl StructuralPartialEq for RequestVoteReply
Auto Trait Implementations§
impl Freeze for RequestVoteReply
impl RefUnwindSafe for RequestVoteReply
impl Send for RequestVoteReply
impl Sync for RequestVoteReply
impl Unpin for RequestVoteReply
impl UnsafeUnpin for RequestVoteReply
impl UnwindSafe for RequestVoteReply
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