pub trait CanonStateSubscriptions: Send + Sync {
// Required method
fn subscribe_to_canonical_state(&self) -> CanonStateNotifications;
// Provided method
fn canonical_state_stream(&self) -> CanonStateNotificationStream { ... }
}
Expand description
A type that allows to register chain related event subscriptions.
Required Methods§
Sourcefn subscribe_to_canonical_state(&self) -> CanonStateNotifications
fn subscribe_to_canonical_state(&self) -> CanonStateNotifications
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
fn canonical_state_stream(&self) -> CanonStateNotificationStream
Convenience method to get a stream of CanonStateNotification
.
Implementations on Foreign Types§
Source§impl<'a, T: 'a + CanonStateSubscriptions + ?Sized> CanonStateSubscriptions for &'a T
impl<'a, T: 'a + CanonStateSubscriptions + ?Sized> CanonStateSubscriptions for &'a T
Source§impl<T: CanonStateSubscriptions + ?Sized> CanonStateSubscriptions for Arc<T>
impl<T: CanonStateSubscriptions + ?Sized> CanonStateSubscriptions for Arc<T>
Implementors§
impl CanonStateSubscriptions for TestCanonStateSubscriptions
Available on crate feature
test-utils
only.