pub trait Manager:
Debug
+ Clone
+ Send
+ 'static {
type PublicKey: PublicKey;
type Peers;
// Required methods
fn update(
&mut self,
id: u64,
peers: Self::Peers,
) -> impl Future<Output = ()> + Send;
fn peer_set(
&mut self,
id: u64,
) -> impl Future<Output = Option<Set<Self::PublicKey>>> + Send;
fn subscribe(
&mut self,
) -> impl Future<Output = UnboundedReceiver<(u64, Set<Self::PublicKey>, Set<Self::PublicKey>)>> + Send;
}Expand description
Interface for registering new peer sets as well as fetching an ordered list of connected peers, given a set id.
Required Associated Types§
Required Methods§
Sourcefn update(
&mut self,
id: u64,
peers: Self::Peers,
) -> impl Future<Output = ()> + Send
fn update( &mut self, id: u64, peers: Self::Peers, ) -> impl Future<Output = ()> + Send
Update the peer set.
The peer set ID passed to this function should be strictly managed, ideally matching the epoch of the consensus engine. It must be monotonically increasing as new peer sets are registered.
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.