Struct cluster_mode::Cluster [−][src]
pub struct Cluster { /* fields omitted */ }
Describes a cluster, including operating mode, primaries & secondaries
Implementations
impl Cluster
[src]
pub fn new(update_interval: u64) -> Self
[src]
Initialize Cluster
Arguments
- update_interval - milliseconds, Interval between discovery service call
pub async fn secondaries(&self) -> Option<Arc<HashSet<RestClusterNode>>>
[src]
Get the list of secondaries. Returns None
if Cluster is inactive or in
Secondary mode. List can be empty.
pub async fn primaries(&self) -> Option<HashSet<RestClusterNode>>
[src]
Get the list of primaries. Returns None
if Cluster is inactive or in
Primary mode. List can be empty.
pub async fn is_primary(&self) -> bool
[src]
true if Cluster mode is Primary
pub async fn is_secondary(&self) -> bool
[src]
true if Cluster mode is Secondary
pub async fn is_active(&self) -> bool
[src]
true if Cluster mode is not Inactive
pub async fn accept_raft_request_vote(
&self,
requester_node_id: String,
term: usize
)
[src]
&self,
requester_node_id: String,
term: usize
)
Forward almost_raft::Message::RequestVote message to Raft process
pub async fn accept_raft_request_vote_resp(&self, term: usize, vote: bool)
[src]
Forward almost_raft::Message::RequestVoteResponse message to Raft process
pub async fn accept_raft_heartbeat(&self, leader_node_id: String, term: usize)
[src]
Forward almost_raft::Message::HeartBeat message to Raft process
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Cluster
impl Send for Cluster
impl Sync for Cluster
impl Unpin for Cluster
impl !UnwindSafe for Cluster
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,