reth_rpc::eth

Trait RpcNodeCore

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§

type Provider: Send + Sync + Clone + Unpin

The provider type used to interact with the node.

type Pool: Send + Sync + Clone + Unpin

The transaction pool of the node.

type Evm: Send + Sync + Clone + Unpin

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

type Network: Send + Sync + Clone

Network API.

type PayloadBuilder: Send + Sync + Clone

Builds new blocks.

Required Methods§

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

Returns the transaction pool of the node.

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

Returns the node’s evm config.

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

Returns the handle to the network

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

Returns the handle to the payload builder service.

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: Send + Sync + 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 = ()

§

impl<T> RpcNodeCore for T
where T: FullNodeComponents,

§

type Provider = <T as FullNodeTypes>::Provider

§

type Pool = <T as FullNodeComponents>::Pool

§

type Evm = <T as FullNodeComponents>::Evm

§

type Network = <T as FullNodeComponents>::Network

§

type PayloadBuilder = <T as FullNodeComponents>::PayloadBuilder