pub struct ClusterState { /* private fields */ }
Expand description
Cluster state management
Implementations§
Source§impl ClusterState
impl ClusterState
Sourcepub fn update_topology(&mut self, nodes: &[NodeInfo]) -> CoreResult<()>
pub fn update_topology(&mut self, nodes: &[NodeInfo]) -> CoreResult<()>
Update the cluster topology with new node information
Sourcepub fn needs_leader_election(&self) -> bool
pub fn needs_leader_election(&self) -> bool
Check if leader election is needed
Sourcepub fn set_leader(&mut self, nodeid: String)
pub fn set_leader(&mut self, nodeid: String)
Set the cluster leader
Sourcepub fn get_leader(&self) -> Option<&String>
pub fn get_leader(&self) -> Option<&String>
Get the current cluster leader
Sourcepub fn get_topology(&self) -> &ClusterTopology
pub fn get_topology(&self) -> &ClusterTopology
Get the cluster topology
Sourcepub fn last_updated(&self) -> Instant
pub fn last_updated(&self) -> Instant
Get the last update timestamp
Trait Implementations§
Source§impl Debug for ClusterState
impl Debug for ClusterState
Auto Trait Implementations§
impl Freeze for ClusterState
impl RefUnwindSafe for ClusterState
impl Send for ClusterState
impl Sync for ClusterState
impl Unpin for ClusterState
impl UnwindSafe for ClusterState
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> 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