pub trait AwaitNewBlock {
// Required method
async fn await_new_block(&mut self) -> Option<()>;
}
Expand description
Types that may be provided to subscribe_blocks
to asynchronously await
the availability of a new block.
Required Methods§
Sourceasync fn await_new_block(&mut self) -> Option<()>
async fn await_new_block(&mut self) -> Option<()>
Wait for a new block to become available.
Returns a future that resolves to Some
when a new block is ready, or
None
when the notification source is no longer available.
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.