pub trait ChainApiBackend: Send + Sync {
// Required methods
fn header<'life0, 'async_trait>(
&'life0 self,
hash: Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<Header>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Info<Block>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn number<'life0, 'async_trait>(
&'life0 self,
hash: Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<<Header as HeaderT>::Number>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn hash<'life0, 'async_trait>(
&'life0 self,
number: NumberFor<Block>,
) -> Pin<Box<dyn Future<Output = Result<Option<Hash>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Offers header utilities.
This is a async wrapper trait for [‘HeaderBackend’] to be used with the
ChainApiSubsystem
.
Required Methods§
sourcefn header<'life0, 'async_trait>(
&'life0 self,
hash: Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<Header>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn header<'life0, 'async_trait>(
&'life0 self,
hash: Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<Header>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get block header. Returns None
if block is not found.
sourcefn info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Info<Block>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Info<Block>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get blockchain info.