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