pub struct CollectHandler {
pub peer_messages: HashMap<ServerId, Vec<PeerMessage>>,
pub client_messages: HashMap<ClientId, Vec<ClientResponse>>,
pub timeouts: Vec<ConsensusTimeout>,
pub clear_timeouts: Vec<ConsensusTimeout>,
pub state: ConsensusState,
}
Expand description
A handler that collects all messages leaving processing of them untouched. Note that timeouts vectors may intersect, that means both - clearing and setting a new timeout was requested.
Fields§
§peer_messages: HashMap<ServerId, Vec<PeerMessage>>
§client_messages: HashMap<ClientId, Vec<ClientResponse>>
§timeouts: Vec<ConsensusTimeout>
§clear_timeouts: Vec<ConsensusTimeout>
§state: ConsensusState
Implementations§
Trait Implementations§
Source§impl ConsensusHandler for CollectHandler
impl ConsensusHandler for CollectHandler
Source§fn send_peer_message(&mut self, id: ServerId, message: PeerMessage)
fn send_peer_message(&mut self, id: ServerId, message: PeerMessage)
Saves peer message to a vector
Source§fn send_client_response(&mut self, id: ClientId, message: ClientResponse)
fn send_client_response(&mut self, id: ClientId, message: ClientResponse)
Saves client message to a vector
Source§fn set_timeout(&mut self, timeout: ConsensusTimeout)
fn set_timeout(&mut self, timeout: ConsensusTimeout)
Collects timeouts uniquely
fn clear_timeout(&mut self, timeout: ConsensusTimeout)
Source§fn 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.
Source§impl Debug for CollectHandler
impl Debug for CollectHandler
Auto Trait Implementations§
impl Freeze for CollectHandler
impl RefUnwindSafe for CollectHandler
impl Send for CollectHandler
impl Sync for CollectHandler
impl Unpin for CollectHandler
impl UnwindSafe for CollectHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more