Trait paxakos::voting::Voter[][src]

pub trait Voter: Send + 'static {
    type State: State;
    type RoundNum: RoundNum;
    type CoordNum: CoordNum;
    type Yea: Debug + Send + Sync;
    type Nay: Debug + Send + Sync;
    type Abstain: Debug + Send + Sync;
    fn contemplate_candidate(
        &mut self,
        round_num: Self::RoundNum,
        coord_num: Self::CoordNum,
        candidate: Option<&NodeOf<Self::State>>,
        state: Option<&Self::State>
    ) -> Decision<(), Infallible, Self::Abstain>;
fn contemplate_proposal(
        &mut self,
        round_num: Self::RoundNum,
        coord_num: Self::CoordNum,
        log_entry: &LogEntryOf<Self::State>,
        leader: Option<&NodeOf<Self::State>>,
        state: Option<&Self::State>
    ) -> Decision<Self::Yea, Self::Nay, Infallible>; fn observe_commit(
        &mut self,
        round_num: Self::RoundNum,
        coord_num: Self::CoordNum,
        log_entry: &LogEntryOf<Self::State>,
        leader: Option<&NodeOf<Self::State>>
    ) { ... } }
Expand description

Strategy to vote on candidates and proposals.

Associated Types

Type of shared state.

Round number type.

Coordination number type.

Data that will be added to any Yea vote on proposals.

Data that will be added to any Nay vote on proposals.

Data that will be added to any Abstain from elections.

Required methods

Contemplate a bid for leadership.

candidate will be None if the node cannot be inferred due to missing or outdated state.

Careful: state is the current applied state and independent of round_num.

Contemplate a proposed log entry.

leader will be None if the node cannot be inferred due to missing or outdated state.

Careful: state is the current applied state and independent of round_num.

Provided methods

Called for every commit.

leader will be None if the node cannot be inferred due to missing or outdated state.

Implementors