pub struct NodeInfo {
pub id: String,
pub address: String,
pub role: NodeRole,
pub status: NodeStatus,
pub cpu_cores: u32,
pub memory_mb: u32,
pub has_gpu: bool,
pub registered_at_ms: u64,
pub last_seen_ms: u64,
pub tags: Vec<String>,
}Expand description
Information about a registered cluster node.
Fields§
§id: StringUnique node identifier.
address: StringNetwork address (host:port).
role: NodeRoleAssigned role in the cluster.
status: NodeStatusCurrent operational status.
cpu_cores: u32Number of CPU cores.
memory_mb: u32Total RAM in megabytes.
has_gpu: boolWhether this node has GPU acceleration.
registered_at_ms: u64Unix epoch ms when the node was registered.
last_seen_ms: u64Unix epoch ms of the last status update.
Arbitrary tags (e.g., “av1”, “region:eu-west-1”).
Implementations§
Source§impl NodeInfo
impl NodeInfo
Sourcepub fn new(
id: impl Into<String>,
address: impl Into<String>,
role: NodeRole,
cpu_cores: u32,
memory_mb: u32,
has_gpu: bool,
now_ms: u64,
) -> Self
pub fn new( id: impl Into<String>, address: impl Into<String>, role: NodeRole, cpu_cores: u32, memory_mb: u32, has_gpu: bool, now_ms: u64, ) -> Self
Create a new healthy node registration.
Sourcepub fn touch(&mut self, now_ms: u64, status: NodeStatus)
pub fn touch(&mut self, now_ms: u64, status: NodeStatus)
Update the last-seen timestamp and optionally the status.
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Returns true if the node can accept work.
Trait Implementations§
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<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