reth::rpc::api::servers::eth::node

Trait RpcNodeCore

Source
pub trait RpcNodeCore:
    Clone
    + Send
    + Sync {
    type Provider: Send + Sync + Clone + Unpin;
    type Pool: Send + Sync + Clone + Unpin;
    type Evm: Send + Sync + Clone + Unpin;
    type Network: Send + Sync + Clone;
    type PayloadBuilder: Send + Sync + Clone;

    // Required methods
    fn pool(&self) -> &Self::Pool;
    fn evm_config(&self) -> &Self::Evm;
    fn network(&self) -> &Self::Network;
    fn payload_builder(&self) -> &Self::PayloadBuilder;
    fn provider(&self) -> &Self::Provider;
}
Expand description

Helper trait to relax trait bounds on FullNodeComponents.

Helpful when defining types that would otherwise have a generic N: FullNodeComponents. Using N: RpcNodeCore instead, allows access to all the associated types on FullNodeComponents that are used in RPC, but with more flexibility since they have no trait bounds (asides auto traits).

Required Associated Types§

Source

type Provider: Send + Sync + Clone + Unpin

The provider type used to interact with the node.

Source

type Pool: Send + Sync + Clone + Unpin

The transaction pool of the node.

Source

type Evm: Send + Sync + Clone + Unpin

The node’s EVM configuration, defining settings for the Ethereum Virtual Machine.

Source

type Network: Send + Sync + Clone

Network API.

Source

type PayloadBuilder: Send + Sync + Clone

Builds new blocks.

Required Methods§

Source

fn pool(&self) -> &Self::Pool

Returns the transaction pool of the node.

Source

fn evm_config(&self) -> &Self::Evm

Returns the node’s evm config.

Source

fn network(&self) -> &Self::Network

Returns the handle to the network

Source

fn payload_builder(&self) -> &Self::PayloadBuilder

Returns the handle to the payload builder service.

Source

fn provider(&self) -> &Self::Provider

Returns the provider of the node.

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§

Source§

impl<Provider, Pool, Network, EvmConfig> RpcNodeCore for EthApi<Provider, Pool, Network, EvmConfig>
where Provider: BlockReader + Clone + Unpin, Pool: Send + Sync + Clone + Unpin, Network: Send + Sync + Clone, EvmConfig: Send + Sync + Clone + Unpin,

Source§

type Provider = Provider

Source§

type Pool = Pool

Source§

type Evm = EvmConfig

Source§

type Network = Network

Source§

type PayloadBuilder = ()

Source§

impl<T> RpcNodeCore for T