Skip to main content

HeaderSubscription

Trait HeaderSubscription 

Source
pub trait HeaderSubscription<Block>
where Block: Block, <Block as Block>::Header: Header,
{ // Required method fn next_header<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Option<<Block as Block>::Header>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; }
Expand description

Abstraction over RPC subscription for finalized headers.

Required Methods§

Source

fn next_header<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Option<<Block as Block>::Header>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Await for the next finalized header from the subscription.

Returns None if either the subscription has been closed or there was an error when reading an object from the client.

Implementors§

Source§

impl<Block> HeaderSubscription<Block> for Subscription<<Block as Block>::Header>
where Block: Block, <Block as Block>::Header: DeserializeOwned,