pub trait Coordinator:
Clone
+ Send
+ Sync
+ 'static {
type PublicKey: PublicKey;
// Required methods
fn peers(&self) -> &Vec<Self::PublicKey>;
fn peer_set_id(&self) -> u64;
}
Expand description
Manages the set of peers that can be used to fetch data.
Required Associated Types§
Required Methods§
Sourcefn peers(&self) -> &Vec<Self::PublicKey>
fn peers(&self) -> &Vec<Self::PublicKey>
Returns the current list of peers that can be used to fetch data.
This is also used to filter requests from peers.
Sourcefn peer_set_id(&self) -> u64
fn peer_set_id(&self) -> u64
Returns an identifier for the peer set.
Used as a low-overhead way to check if the list of peers has changed, this value must change to a novel value whenever the list of peers changes. For example, it could be an incrementing counter, or an epoch.
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.