pub struct NodeInfo {
pub node_id: u64,
pub addr: String,
pub state: NodeState,
pub raft_groups: Vec<u64>,
pub wire_version: u16,
pub spiffe_id: Option<String>,
pub spki_pin: Option<[u8; 32]>,
}Expand description
Information about a single node in the cluster.
Fields§
§node_id: u64§addr: StringListen address for Raft RPCs (as string for serialization portability).
state: NodeState§raft_groups: Vec<u64>Raft groups hosted on this node.
wire_version: u16Wire format version this node is running. Stamped by the
node itself on self-registration (bootstrap / join) and by
handle_join when learning about a remote joiner. Read by
control::rolling_upgrade::view::compute to derive the
cluster-wide min/max/mixed view on demand from the live
topology.
spiffe_id: Option<String>SPIFFE URI SAN (e.g. spiffe://cluster.local/node/1) extracted from
the node’s mTLS leaf certificate at join time. None for nodes that
joined before SPIFFE identity was introduced or that are running in
insecure transport mode.
spki_pin: Option<[u8; 32]>SHA-256 digest of the node’s SubjectPublicKeyInfo DER blob, pinned at
join time. Stable across cert renewals that reuse the same key-pair;
changes on key rotation. None until the node has joined and
transmitted its identity fields.
Implementations§
Source§impl NodeInfo
impl NodeInfo
Sourcepub fn new(node_id: u64, addr: SocketAddr, state: NodeState) -> Self
pub fn new(node_id: u64, addr: SocketAddr, state: NodeState) -> Self
Construct a NodeInfo stamped with this build’s wire version.
Use NodeInfo::with_wire_version when stamping a remote
node whose version arrived over the wire.
Sourcepub fn with_wire_version(self, wire_version: u16) -> Self
pub fn with_wire_version(self, wire_version: u16) -> Self
Override the wire version on an otherwise-fresh NodeInfo.
Builder-style so call sites read as
NodeInfo::new(id, addr, state).with_wire_version(remote_v).
Sourcepub fn with_spiffe_id(self, spiffe_id: Option<String>) -> Self
pub fn with_spiffe_id(self, spiffe_id: Option<String>) -> Self
Set the SPIFFE URI SAN for this node. Builder-style.
Sourcepub fn with_spki_pin(self, spki_pin: Option<[u8; 32]>) -> Self
pub fn with_spki_pin(self, spki_pin: Option<[u8; 32]>) -> Self
Set the SPKI fingerprint pin for this node. Builder-style.
pub fn socket_addr(&self) -> Option<SocketAddr>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeInfo
impl<'de> Deserialize<'de> for NodeInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'__msgpack_de> FromMessagePack<'__msgpack_de> for NodeInfo
impl<'__msgpack_de> FromMessagePack<'__msgpack_de> for NodeInfo
Auto Trait Implementations§
impl Freeze for NodeInfo
impl RefUnwindSafe for NodeInfo
impl Send for NodeInfo
impl Sync for NodeInfo
impl Unpin for NodeInfo
impl UnsafeUnpin for NodeInfo
impl UnwindSafe for NodeInfo
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.