pub trait NetworkEventListenerProvider: NetworkPeersEvents {
type Primitives: NetworkPrimitives;
// Required methods
fn event_listener(
&self,
) -> EventStream<NetworkEvent<PeerRequest<Self::Primitives>>>;
fn discovery_listener(&self) -> UnboundedReceiverStream<DiscoveryEvent>;
}
Expand description
Provides event subscription for the network.
Required Associated Types§
Sourcetype Primitives: NetworkPrimitives
type Primitives: NetworkPrimitives
The primitive types to use in the PeerRequest
used in the stream.
Required Methods§
Sourcefn event_listener(
&self,
) -> EventStream<NetworkEvent<PeerRequest<Self::Primitives>>>
fn event_listener( &self, ) -> EventStream<NetworkEvent<PeerRequest<Self::Primitives>>>
Creates a new NetworkEvent
listener channel.
Sourcefn discovery_listener(&self) -> UnboundedReceiverStream<DiscoveryEvent>
fn discovery_listener(&self) -> UnboundedReceiverStream<DiscoveryEvent>
Returns a new DiscoveryEvent
stream.
This stream yields DiscoveryEvent
s for each peer that is discovered.