Trait raft_consensus::handler::ConsensusHandler [−][src]
pub trait ConsensusHandler: Debug { fn send_peer_message(&mut self, id: ServerId, message: PeerMessage); fn send_client_response(&mut self, id: ClientId, message: ClientResponse); fn set_timeout(&mut self, timeout: ConsensusTimeout); fn clear_timeout(&mut self, timeout: ConsensusTimeout); fn state_changed(&mut self, old: ConsensusState, new: ConsensusState) { ... } fn done(&mut self) { ... } }
Handler for actions returned from consensus
Required Methods
fn send_peer_message(&mut self, id: ServerId, message: PeerMessage)
fn send_client_response(&mut self, id: ClientId, message: ClientResponse)
fn set_timeout(&mut self, timeout: ConsensusTimeout)
fn clear_timeout(&mut self, timeout: ConsensusTimeout)
Provided Methods
fn state_changed(&mut self, old: ConsensusState, new: ConsensusState)
Called when consensus goes to new state. Initializing new consensus does not call this function.
fn done(&mut self)
Called when the particular event has been fully processed. Useful for doing actions in batches.
Implementors
impl ConsensusHandler for CollectHandler