pub struct OrchestratorNode {
pub nodeid: String,
pub address: SocketAddr,
pub capacity: usize,
pub current_load: usize,
pub capabilities: Vec<String>,
pub last_heartbeat: Instant,
}
Expand description
Node information for orchestration
Fields§
§nodeid: String
§address: SocketAddr
§capacity: usize
§current_load: usize
§capabilities: Vec<String>
§last_heartbeat: Instant
Implementations§
Source§impl OrchestratorNode
impl OrchestratorNode
Sourcepub fn id(nodeid: String, address: SocketAddr, capacity: usize) -> Self
pub fn id(nodeid: String, address: SocketAddr, capacity: usize) -> Self
Create a new orchestrator node
Sourcepub fn new(nodeid: String, address: SocketAddr, capacity: usize) -> Self
pub fn new(nodeid: String, address: SocketAddr, capacity: usize) -> Self
Create a new orchestrator node (alias for id)
Sourcepub fn can_accept_task(&self) -> bool
pub fn can_accept_task(&self) -> bool
Check if node can accept more tasks
Sourcepub fn update_heartbeat(&mut self)
pub fn update_heartbeat(&mut self)
Update node heartbeat
Sourcepub fn is_responsive(&self, timeout: Duration) -> bool
pub fn is_responsive(&self, timeout: Duration) -> bool
Check if node is responsive
Trait Implementations§
Source§impl Clone for OrchestratorNode
impl Clone for OrchestratorNode
Source§fn clone(&self) -> OrchestratorNode
fn clone(&self) -> OrchestratorNode
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 moreAuto Trait Implementations§
impl Freeze for OrchestratorNode
impl RefUnwindSafe for OrchestratorNode
impl Send for OrchestratorNode
impl Sync for OrchestratorNode
impl Unpin for OrchestratorNode
impl UnwindSafe for OrchestratorNode
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more