Trait EthClientApiServer

Source
pub trait EthClientApiServer:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn chain_id<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<U64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn syncing<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<SyncingStatus>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn author<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Address>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn accounts<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Address>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn block_number<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<U64>> + 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 EthClientApi RPC API.

Required Methods§

Source

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

Returns the chain ID of the current network.

Source

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

Returns an object with data about the sync status or false.

Source

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

Returns the client coinbase address.

Source

fn accounts<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Address>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a list of addresses owned by client.

Source

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

Returns the number of most recent block.

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§