pub struct NodeInfo {
pub nodeid: String,
pub address: SocketAddr,
pub health: NodeHealth,
pub last_seen: Instant,
pub failure_count: usize,
pub recovery_strategy: RecoveryStrategy,
}
Expand description
Node information for fault tolerance
Fields§
§nodeid: String
§address: SocketAddr
§health: NodeHealth
§last_seen: Instant
§failure_count: usize
§recovery_strategy: RecoveryStrategy
Implementations§
Source§impl NodeInfo
impl NodeInfo
Sourcepub fn new(nodeid: String, address: SocketAddr) -> Self
pub fn new(nodeid: String, address: SocketAddr) -> Self
Create new node info
Sourcepub fn update_health(&mut self, health: NodeHealth)
pub fn update_health(&mut self, health: NodeHealth)
Update node health status
Sourcepub fn is_healthy(&self) -> bool
pub fn is_healthy(&self) -> bool
Check if node is healthy
Sourcepub fn has_failed(&self) -> bool
pub fn has_failed(&self) -> bool
Check if node has failed
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 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> 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