pub struct ClusterNode {
pub node_id: String,
pub address: String,
pub role: NodeRole,
pub health: NodeHealth,
pub last_heartbeat_epoch: u64,
}Expand description
A node in the distributed cluster.
Fields§
§node_id: StringUnique node identifier.
address: StringNetwork address of the node (e.g. “192.168.1.10:50051”).
role: NodeRoleCurrent role of the node.
health: NodeHealthCurrent health status.
last_heartbeat_epoch: u64Unix epoch timestamp of the last received heartbeat.
Implementations§
Source§impl ClusterNode
impl ClusterNode
Sourcepub fn new(
node_id: impl Into<String>,
address: impl Into<String>,
role: NodeRole,
health: NodeHealth,
last_heartbeat_epoch: u64,
) -> Self
pub fn new( node_id: impl Into<String>, address: impl Into<String>, role: NodeRole, health: NodeHealth, last_heartbeat_epoch: u64, ) -> Self
Create a new cluster node.
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 (const: unstable) · 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 ClusterNode
impl RefUnwindSafe for ClusterNode
impl Send for ClusterNode
impl Sync for ClusterNode
impl Unpin for ClusterNode
impl UnsafeUnpin 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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request