reth::network

Trait NetworkEventListenerProvider

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

Source

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

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§

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

Source§

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

Source§

impl<T> NetworkEventListenerProvider for Arc<T>

Source§

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

Source§

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

Implementors§