pub trait ConsensusHandler: Debug {
// 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) { ... }
fn done(&mut self) { ... }
}
Expand description
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§
Sourcefn state_changed(&mut self, old: ConsensusState, new: ConsensusState)
fn state_changed(&mut self, old: ConsensusState, new: ConsensusState)
Called when consensus goes to new state. Initializing new consensus does not call this function.