pub trait Network: Clone + Send {
// Required methods
fn init_validator_set(&mut self, validator_set: ValidatorSet);
fn update_validator_set(&mut self, updates: ValidatorSetUpdates);
fn broadcast(&mut self, message: Message);
fn send(&mut self, peer: VerifyingKey, message: Message);
fn recv(&mut self) -> Option<(VerifyingKey, Message)>;
}
Required Methods§
sourcefn init_validator_set(&mut self, validator_set: ValidatorSet)
fn init_validator_set(&mut self, validator_set: ValidatorSet)
Inform the network provider the validator set on wake-up.
sourcefn update_validator_set(&mut self, updates: ValidatorSetUpdates)
fn update_validator_set(&mut self, updates: ValidatorSetUpdates)
Inform the networking provider of updates to the validator set.
sourcefn broadcast(&mut self, message: Message)
fn broadcast(&mut self, message: Message)
Send a message to all peers (including listeners) without blocking.
sourcefn send(&mut self, peer: VerifyingKey, message: Message)
fn send(&mut self, peer: VerifyingKey, message: Message)
Send a message to the specified peer without blocking.
sourcefn recv(&mut self) -> Option<(VerifyingKey, Message)>
fn recv(&mut self) -> Option<(VerifyingKey, Message)>
Receive a message from any peer. Returns immediately with a None if no message is available now.
Object Safety§
This trait is not object safe.