//! Network component for the node builder. use crate::{BuilderContext, FullNodeTypes}; use reth_network::NetworkHandle; use reth_transaction_pool::TransactionPool; use std::future::Future; /// A type that knows how to build the network implementation. pub trait NetworkBuilder: Send { /// Launches the network implementation and returns the handle to it. fn build_network( self, ctx: &BuilderContext, pool: Pool, ) -> impl Future> + Send; } impl NetworkBuilder for F where Node: FullNodeTypes, Pool: TransactionPool, F: Fn(&BuilderContext, Pool) -> Fut + Send, Fut: Future> + Send, { fn build_network( self, ctx: &BuilderContext, pool: Pool, ) -> impl Future> + Send { self(ctx, pool) } }