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]

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

impl Default for Cluster[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,