Trait EthBlockApiServer

Source
pub trait EthBlockApiServer:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn block_by_hash<'life0, 'async_trait>(
        &'life0 self,
        hash: H256,
        full: bool,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Option<Block>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn block_by_number<'life0, 'async_trait>(
        &'life0 self,
        block: BlockNumberOrTag,
        full: bool,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Option<Block>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn block_transaction_count_by_hash<'life0, 'async_trait>(
        &'life0 self,
        block_hash: H256,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Option<U256>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn block_transaction_count_by_number<'life0, 'async_trait>(
        &'life0 self,
        block: BlockNumberOrTag,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Option<U256>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn block_uncles_count_by_hash<'life0, 'async_trait>(
        &'life0 self,
        block_hash: H256,
    ) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn block_uncles_count_by_number<'life0, 'async_trait>(
        &'life0 self,
        block: BlockNumberOrTag,
    ) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn block_transaction_receipts<'life0, 'async_trait>(
        &'life0 self,
        number_or_hash: BlockNumberOrTagOrHash,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Option<Vec<TransactionReceipt>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description

Server trait implementation for the EthBlockApi RPC API.

Required Methods§

Source

fn block_by_hash<'life0, 'async_trait>( &'life0 self, hash: H256, full: bool, ) -> Pin<Box<dyn Future<Output = RpcResult<Option<Block>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns information about a block by hash.

Source

fn block_by_number<'life0, 'async_trait>( &'life0 self, block: BlockNumberOrTag, full: bool, ) -> Pin<Box<dyn Future<Output = RpcResult<Option<Block>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns information about a block by number.

Source

fn block_transaction_count_by_hash<'life0, 'async_trait>( &'life0 self, block_hash: H256, ) -> Pin<Box<dyn Future<Output = RpcResult<Option<U256>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the number of transactions in a block from a block matching the given block hash.

Source

fn block_transaction_count_by_number<'life0, 'async_trait>( &'life0 self, block: BlockNumberOrTag, ) -> Pin<Box<dyn Future<Output = RpcResult<Option<U256>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the number of transactions in a block matching the given block number.

Source

fn block_uncles_count_by_hash<'life0, 'async_trait>( &'life0 self, block_hash: H256, ) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the number of uncles in a block from a block matching the given block hash.

Source

fn block_uncles_count_by_number<'life0, 'async_trait>( &'life0 self, block: BlockNumberOrTag, ) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the number of uncles in a block matching the given block number.

Source

fn block_transaction_receipts<'life0, 'async_trait>( &'life0 self, number_or_hash: BlockNumberOrTagOrHash, ) -> Pin<Box<dyn Future<Output = RpcResult<Option<Vec<TransactionReceipt>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the receipts of a block by number or hash.

Provided Methods§

Source

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

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.

Implementors§