pub struct ClusterNode {
pub node_id: String,
pub address: SocketAddr,
pub status: NodeStatus,
pub last_seen: DateTime<Utc>,
pub metadata: HashMap<String, String>,
pub capacity: f64,
}Expand description
Information about a cluster node
Fields§
§node_id: StringUnique node identifier
address: SocketAddrNetwork address of the node
status: NodeStatusCurrent status of the node
last_seen: DateTime<Utc>Last time the node was seen alive
metadata: HashMap<String, String>Metadata about the node
capacity: f64Node capacity (for load balancing)
Implementations§
Source§impl ClusterNode
impl ClusterNode
Sourcepub fn new(node_id: String, address: SocketAddr) -> Self
pub fn new(node_id: String, address: SocketAddr) -> Self
Create a new cluster node
Sourcepub fn is_healthy(&self, timeout: Duration) -> bool
pub fn is_healthy(&self, timeout: Duration) -> bool
Check if the node is healthy (seen recently)
Trait Implementations§
Source§impl Clone for ClusterNode
impl Clone for ClusterNode
Source§fn clone(&self) -> ClusterNode
fn clone(&self) -> ClusterNode
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 moreSource§impl Debug for ClusterNode
impl Debug for ClusterNode
Source§impl<'de> Deserialize<'de> for ClusterNode
impl<'de> Deserialize<'de> for ClusterNode
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
Auto Trait Implementations§
impl Freeze for ClusterNode
impl RefUnwindSafe for ClusterNode
impl Send for ClusterNode
impl Sync for ClusterNode
impl Unpin for ClusterNode
impl UnwindSafe for ClusterNode
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