Trait AwaitNewBlock

Source
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§

Source

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.

Implementations on Foreign Types§

Source§

impl AwaitNewBlock for BlockRx

Source§

async fn await_new_block(&mut self) -> Option<()>

Implementors§