reth_network_api::events

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: 'a + NetworkEventListenerProvider + ?Sized> NetworkEventListenerProvider for &'a T
where &'a T: Send + Sync,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§