pub trait Provider:
Debug
+ Clone
+ Send
+ 'static {
type PublicKey: PublicKey;
// Required methods
fn peer_set(
&mut self,
id: u64,
) -> impl Future<Output = Option<TrackedPeers<Self::PublicKey>>> + Send;
fn subscribe(
&mut self,
) -> impl Future<Output = PeerSetSubscription<Self::PublicKey>> + Send;
}Expand description
Interface for reading peer set information.
Required Associated Types§
Required Methods§
Sourcefn peer_set(
&mut self,
id: u64,
) -> impl Future<Output = Option<TrackedPeers<Self::PublicKey>>> + Send
fn peer_set( &mut self, id: u64, ) -> impl Future<Output = Option<TrackedPeers<Self::PublicKey>>> + Send
Fetch the primary and secondary peers tracked at the given ID.
Sourcefn subscribe(
&mut self,
) -> impl Future<Output = PeerSetSubscription<Self::PublicKey>> + Send
fn subscribe( &mut self, ) -> impl Future<Output = PeerSetSubscription<Self::PublicKey>> + Send
Subscribe to notifications when new peer sets are added.
Returns a receiver of PeerSetUpdate notifications. Each update’s
latest reflects how Manager::track stored the set: a peer listed in
both roles appears only under latest.primary. The all field aggregates
across tracked sets with the same rule (secondary excludes keys present as primary).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".