Trait Coordinator

Source
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§

Source

type PublicKey: PublicKey

Type used to uniquely identify peers.

Required Methods§

Source

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.

Source

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.

Implementors§