pub trait Relay:
Clone
+ Send
+ 'static {
type Digest: Digest;
// Required method
fn broadcast(
&mut self,
payload: Self::Digest,
) -> impl Future<Output = ()> + Send;
}
Expand description
Relay is the interface responsible for broadcasting payloads to the network.
The consensus engine is only aware of a payload’s digest, not its contents. It is up to the relay to efficiently broadcast the full payload to other participants.
Required Associated Types§
Required Methods§
Sourcefn broadcast(
&mut self,
payload: Self::Digest,
) -> impl Future<Output = ()> + Send
fn broadcast( &mut self, payload: Self::Digest, ) -> impl Future<Output = ()> + Send
Called once consensus begins working towards a proposal provided by Automaton
(i.e.
it isn’t dropped).
Other participants may not begin voting on a proposal until they have the full contents, so timely delivery often yields better performance.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.