reth_provider

Trait CanonStateSubscriptions

pub trait CanonStateSubscriptions:
    NodePrimitivesProvider
    + Send
    + Sync {
    // Required method
    fn subscribe_to_canonical_state(
        &self,
    ) -> Receiver<CanonStateNotification<Self::Primitives>>;

    // Provided method
    fn canonical_state_stream(
        &self,
    ) -> CanonStateNotificationStream<Self::Primitives> { ... }
}
Expand description

A type that allows to register chain related event subscriptions.

Required Methods§

fn subscribe_to_canonical_state( &self, ) -> Receiver<CanonStateNotification<Self::Primitives>>

Get notified when a new canonical chain was imported.

A canonical chain be one or more blocks, a reorg or a revert.

Provided Methods§

fn canonical_state_stream( &self, ) -> CanonStateNotificationStream<Self::Primitives>

Convenience method to get a stream of CanonStateNotification.

Implementations on Foreign Types§

§

impl<T> CanonStateSubscriptions for &T

Implementors§

§

impl CanonStateSubscriptions for TestCanonStateSubscriptions

§

impl<C, N> CanonStateSubscriptions for NoopProvider<C, N>
where C: Send + Sync, N: NodePrimitives,

Source§

impl<N: ProviderNodeTypes> CanonStateSubscriptions for BlockchainProvider<N>

Source§

impl<N: NodeTypesWithDB<Primitives = EthPrimitives>> CanonStateSubscriptions for BlockchainProvider2<N>