pub struct NodeStatus {
pub node_id: NodeId,
pub role: Role,
pub current_term: Term,
pub commit_index: LogIndex,
pub last_applied: LogIndex,
pub leader_hint: Option<NodeId>,
pub peers: Vec<NodeId>,
}Expand description
A snapshot of a Node’s runtime state, returned by
Node::status.
Consistent with what the driver sees at the moment the status request is handled; not a live view — by the time the caller inspects it the node may have moved on.
Fields§
§node_id: NodeIdOur own node id, copied from Config::node_id.
role: RoleCurrent role.
current_term: TermCurrent Raft term (§5.1).
commit_index: LogIndexHighest log index known to be committed cluster-wide.
last_applied: LogIndexHighest log index the driver has handed to the state machine.
Always <= commit_index.
leader_hint: Option<NodeId>If we’re a follower who has observed a current-term leader,
its id; None otherwise (candidate, leader, or a follower
that hasn’t heard from anyone this term yet).
peers: Vec<NodeId>Active peer set (excluding self). Mutates as membership
changes land; see Node::add_peer / remove_peer.
Trait Implementations§
Source§impl Clone for NodeStatus
impl Clone for NodeStatus
Source§fn clone(&self) -> NodeStatus
fn clone(&self) -> NodeStatus
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NodeStatus
impl RefUnwindSafe for NodeStatus
impl Send for NodeStatus
impl Sync for NodeStatus
impl Unpin for NodeStatus
impl UnsafeUnpin for NodeStatus
impl UnwindSafe for NodeStatus
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