Skip to main content

EventSubscriber

Trait EventSubscriber 

Source
pub trait EventSubscriber<N: Network = Ethereum>: Send {
    // Required methods
    fn register_interests(
        &mut self,
        interests: &[ReactiveInterest<N>],
    ) -> Result<(), SubscriberError>;
    fn next_batch(&mut self) -> SubscriberNextBatch<'_, N>;
}
Expand description

Provider-agnostic subscriber interface.

Required Methods§

Source

fn register_interests( &mut self, interests: &[ReactiveInterest<N>], ) -> Result<(), SubscriberError>

Register interests with the subscriber.

Source

fn next_batch(&mut self) -> SubscriberNextBatch<'_, N>

Return the next input batch, or Ok(None) when the stream is exhausted.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<P, N> EventSubscriber<N> for AlloySubscriber<P, N>
where P: Provider<N> + Send + Sync, N: Network + 'static, N::HeaderResponse: Send + 'static,