//! Pool component for the node builder. use crate::{BuilderContext, FullNodeTypes}; use reth_transaction_pool::TransactionPool; use std::future::Future; /// A type that knows how to build the transaction pool. pub trait PoolBuilder: Send { /// The transaction pool to build. type Pool: TransactionPool + Unpin + 'static; /// Creates the transaction pool. fn build_pool( self, ctx: &BuilderContext, ) -> impl Future> + Send; } impl PoolBuilder for F where Node: FullNodeTypes, Pool: TransactionPool + Unpin + 'static, F: FnOnce(&BuilderContext) -> Fut + Send, Fut: Future> + Send, { type Pool = Pool; fn build_pool( self, ctx: &BuilderContext, ) -> impl Future> { self(ctx) } }