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>
fn event_listener(&self) -> EventStream<NetworkEvent>
Creates a new NetworkEvent
listener channel.
fn discovery_listener(&self) -> UnboundedReceiverStream<DiscoveryEvent>
fn discovery_listener(&self) -> UnboundedReceiverStream<DiscoveryEvent>
Returns a new DiscoveryEvent
stream.
This stream yields DiscoveryEvent
s for each peer that is discovered.