pub trait ClusterNode:
MessagePassing
+ Send
+ Sync {
// Required methods
fn node_id(&self) -> &NodeId;
fn cluster_nodes(&self) -> BoxFuture<'_, Result<Vec<NodeId>>>;
fn is_coordinator(&self) -> bool;
fn health_status(&self) -> BoxFuture<'_, Result<NodeHealth>>;
fn resources(&self) -> BoxFuture<'_, Result<NodeResources>>;
fn join_cluster(&mut self, coordinator: NodeId) -> BoxFuture<'_, Result<()>>;
fn leave_cluster(&mut self) -> BoxFuture<'_, Result<()>>;
fn handle_node_failure(
&mut self,
failed_node: NodeId,
) -> BoxFuture<'_, Result<()>>;
}Expand description
Cluster node abstraction for distributed computing
Required Methods§
Sourcefn cluster_nodes(&self) -> BoxFuture<'_, Result<Vec<NodeId>>>
fn cluster_nodes(&self) -> BoxFuture<'_, Result<Vec<NodeId>>>
Get the current cluster membership
Sourcefn is_coordinator(&self) -> bool
fn is_coordinator(&self) -> bool
Check if this node is the cluster coordinator
Sourcefn health_status(&self) -> BoxFuture<'_, Result<NodeHealth>>
fn health_status(&self) -> BoxFuture<'_, Result<NodeHealth>>
Get current node health status
Sourcefn resources(&self) -> BoxFuture<'_, Result<NodeResources>>
fn resources(&self) -> BoxFuture<'_, Result<NodeResources>>
Get node computational resources
Sourcefn leave_cluster(&mut self) -> BoxFuture<'_, Result<()>>
fn leave_cluster(&mut self) -> BoxFuture<'_, Result<()>>
Leave the current cluster