pub struct NodeInfo {
pub id: NodeId,
pub name: Option<String>,
pub rack: Option<String>,
pub client_addr: SocketAddr,
pub cluster_addr: SocketAddr,
pub capabilities: NodeCapabilities,
pub version: String,
pub tags: HashMap<String, String>,
}Expand description
Information about a cluster node
Fields§
§id: NodeIdUnique node identifier
name: Option<String>Human-readable name
rack: Option<String>Rack identifier for rack-aware placement
client_addr: SocketAddrClient-facing address
cluster_addr: SocketAddrCluster communication address
capabilities: NodeCapabilitiesNode capabilities
version: StringNode version (for compatibility checking)
Custom metadata/tags
Implementations§
Source§impl NodeInfo
impl NodeInfo
Sourcepub fn new(
id: impl Into<String>,
client_addr: SocketAddr,
cluster_addr: SocketAddr,
) -> Self
pub fn new( id: impl Into<String>, client_addr: SocketAddr, cluster_addr: SocketAddr, ) -> Self
Create new node info
Sourcepub fn with_capabilities(self, capabilities: NodeCapabilities) -> Self
pub fn with_capabilities(self, capabilities: NodeCapabilities) -> Self
Set capabilities
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for NodeInfo
impl StructuralPartialEq 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> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.