reth_rpc_eth_api::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<T> RpcNodeCore for T
where T: FullNodeComponents,

Source§

type Provider = <T as FullNodeTypes>::Provider

Source§

type Pool = <T as FullNodeComponents>::Pool

Source§

type Evm = <T as FullNodeComponents>::Evm

Source§

type Network = <T as FullNodeComponents>::Network

Source§

type PayloadBuilder = <T as FullNodeComponents>::PayloadBuilder