pub trait ChainEvents {
type Error: Error + Send + Sync;
// Required method
fn subscribe_with_state_sync<I: IntoIterator<Item = StateSyncOptions>>(
&self,
options: I,
) -> Result<impl Stream<Item = ChainEvent> + Send + 'static, Self::Error>;
// Provided method
fn subscribe(
&self,
) -> Result<impl Stream<Item = ChainEvent> + Send + 'static, Self::Error> { ... }
}Expand description
Allows subscribing to on-chain events.
Required Associated Types§
Required Methods§
Sourcefn subscribe_with_state_sync<I: IntoIterator<Item = StateSyncOptions>>(
&self,
options: I,
) -> Result<impl Stream<Item = ChainEvent> + Send + 'static, Self::Error>
fn subscribe_with_state_sync<I: IntoIterator<Item = StateSyncOptions>>( &self, options: I, ) -> Result<impl Stream<Item = ChainEvent> + Send + 'static, Self::Error>
Subscribe to on-chain events.
The options specify which parts of the current state should be streamed
in the form on ChainEvents before any future events are streamed.
When an empty iterator (or simply None) is specified, only all future events are streamed from this point.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.