pub trait NetworkEventStream {
    fn event_stream(
        &self,
        name: &'static str
    ) -> Pin<Box<dyn Stream<Item = Event> + Send>>; }
Expand description

Provides access to network-level event stream.

Required Methods§

Returns a stream containing the events that happen on the network.

If this method is called multiple times, the events are duplicated.

The stream never ends (unless the NetworkWorker gets shut down).

The name passed is used to identify the channel in the Prometheus metrics. Note that the parameter is a &'static str, and not a String, in order to avoid accidentally having an unbounded set of Prometheus metrics, which would be quite bad in terms of memory

Implementations on Foreign Types§

Implementors§