reth_network

Trait NetworkEventListenerProvider

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§

type Primitives: NetworkPrimitives

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

Required Methods§

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

Creates a new NetworkEvent listener channel.

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§

§

impl<'a, T> NetworkEventListenerProvider for &'a T
where T: 'a + NetworkEventListenerProvider + ?Sized, &'a T: NetworkPeersEvents,

§

impl<T> NetworkEventListenerProvider for Arc<T>
where T: NetworkEventListenerProvider + ?Sized, Arc<T>: NetworkPeersEvents,

Implementors§