reth::network

Trait NetworkEventListenerProvider

pub trait NetworkEventListenerProvider: Send + Sync {
    // Required methods
    fn event_listener(&self) -> EventStream<NetworkEvent>;
    fn discovery_listener(&self) -> UnboundedReceiverStream<DiscoveryEvent>;
}
Expand description

Provides event subscription for the network.

Required Methods§

fn event_listener(&self) -> EventStream<NetworkEvent>

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

§

fn event_listener(&self) -> EventStream<NetworkEvent>

§

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

§

impl<T> NetworkEventListenerProvider for Arc<T>

§

fn event_listener(&self) -> EventStream<NetworkEvent>

§

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

Implementors§