pub trait NotificationsExt {
// Required method
fn wait_for<T>(
&mut self,
f: impl FnMut(Notification) -> Option<T>,
) -> impl Future<Output = Result<T>>;
// Provided methods
fn wait_for_events(
&mut self,
expected_height: impl Into<Option<BlockHeight>>,
) -> impl Future<Output = Result<BTreeSet<StreamId>>> { ... }
fn wait_for_block(
&mut self,
expected_height: impl Into<Option<BlockHeight>>,
) -> impl Future<Output = Result<CryptoHash>> { ... }
fn wait_for_bundle(
&mut self,
expected_origin: ChainId,
expected_height: impl Into<Option<BlockHeight>>,
) -> impl Future<Output = Result<()>> { ... }
}Required Methods§
Provided Methods§
Sourcefn wait_for_events(
&mut self,
expected_height: impl Into<Option<BlockHeight>>,
) -> impl Future<Output = Result<BTreeSet<StreamId>>>
fn wait_for_events( &mut self, expected_height: impl Into<Option<BlockHeight>>, ) -> impl Future<Output = Result<BTreeSet<StreamId>>>
Waits for a NewEvents notification for the given block height. If no height is specified,
any height is accepted.
Sourcefn wait_for_block(
&mut self,
expected_height: impl Into<Option<BlockHeight>>,
) -> impl Future<Output = Result<CryptoHash>>
fn wait_for_block( &mut self, expected_height: impl Into<Option<BlockHeight>>, ) -> impl Future<Output = Result<CryptoHash>>
Waits for a NewBlock notification for the given block height. If no height is specified,
any height is accepted.
Sourcefn wait_for_bundle(
&mut self,
expected_origin: ChainId,
expected_height: impl Into<Option<BlockHeight>>,
) -> impl Future<Output = Result<()>>
fn wait_for_bundle( &mut self, expected_origin: ChainId, expected_height: impl Into<Option<BlockHeight>>, ) -> impl Future<Output = Result<()>>
Waits for a NewIncomingBundle notification for the given sender chain and sender block
height. If no height is specified, any height is accepted.
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.