reth::network

Trait NetworkEventListenerProvider

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

Source

type Primitives: NetworkPrimitives

The primitive types to use in the PeerRequest used in the stream.

Required Methods§

Source

fn event_listener( &self, ) -> EventStream<NetworkEvent<PeerRequest<Self::Primitives>>>

Creates a new NetworkEvent listener channel.

Source

fn discovery_listener(&self) -> UnboundedReceiverStream<DiscoveryEvent>

Returns a new DiscoveryEvent stream.

This stream yields DiscoveryEvents for each peer that is discovered.

Implementations on Foreign Types§

Source§

impl<'a, T> NetworkEventListenerProvider for &'a T

Source§

impl<T> NetworkEventListenerProvider for Arc<T>

Implementors§