pub trait CanonStateSubscriptions:
NodePrimitivesProvider
+ Send
+ Sync {
// Required method
fn subscribe_to_canonical_state(
&self,
) -> CanonStateNotifications<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§
Sourcefn subscribe_to_canonical_state(
&self,
) -> CanonStateNotifications<Self::Primitives>
fn subscribe_to_canonical_state( &self, ) -> CanonStateNotifications<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§
Sourcefn canonical_state_stream(
&self,
) -> CanonStateNotificationStream<Self::Primitives>
fn canonical_state_stream( &self, ) -> CanonStateNotificationStream<Self::Primitives>
Convenience method to get a stream of CanonStateNotification
.
Implementations on Foreign Types§
Source§impl<C: Send + Sync, N: NodePrimitives> CanonStateSubscriptions for NoopProvider<C, N>
impl<C: Send + Sync, N: NodePrimitives> CanonStateSubscriptions for NoopProvider<C, N>
fn subscribe_to_canonical_state(&self) -> CanonStateNotifications<N>
Source§impl<T: CanonStateSubscriptions> CanonStateSubscriptions for &T
impl<T: CanonStateSubscriptions> CanonStateSubscriptions for &T
fn subscribe_to_canonical_state( &self, ) -> CanonStateNotifications<Self::Primitives>
fn canonical_state_stream( &self, ) -> CanonStateNotificationStream<Self::Primitives>
Implementors§
impl CanonStateSubscriptions for TestCanonStateSubscriptions
Available on crate feature
test-utils
only.