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>

Replace all interests registered with the subscriber.

Implementations may use this as a full setup/reset operation. The in-crate AlloySubscriber clears owner-scoped interest state and delivery/dedupe bookkeeping when this method is called.

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,