Trait NetworkBuilder

pub trait NetworkBuilder<Node, Pool>: Send
where Node: FullNodeTypes, Pool: TransactionPool,
{ type Network: FullNetwork where <Self::Network as NetworkEventListenerProvider>::Primitives: NetPrimitivesFor<<<Node as FullNodeTypes>::Types as NodeTypes>::Primitives>; // Required method fn build_network( self, ctx: &BuilderContext<Node>, pool: Pool, ) -> impl Future<Output = Result<Self::Network, Report>> + Send; }
Expand description

A type that knows how to build the network implementation.

Required Associated Types§

type Network: FullNetwork where <Self::Network as NetworkEventListenerProvider>::Primitives: NetPrimitivesFor<<<Node as FullNodeTypes>::Types as NodeTypes>::Primitives>

The network built.

Required Methods§

fn build_network( self, ctx: &BuilderContext<Node>, pool: Pool, ) -> impl Future<Output = Result<Self::Network, Report>> + Send

Launches the network implementation and returns the handle to it.

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.

Implementations on Foreign Types§

§

impl<Node, Pool> NetworkBuilder<Node, Pool> for EthereumNetworkBuilder

§

type Network = NetworkHandle<BasicNetworkPrimitives<<<Node as FullNodeTypes>::Types as NodeTypes>::Primitives, <<Pool as TransactionPool>::Transaction as PoolTransaction>::Pooled>>

§

async fn build_network( self, ctx: &BuilderContext<Node>, pool: Pool, ) -> Result<<EthereumNetworkBuilder as NetworkBuilder<Node, Pool>>::Network, Report>

Implementors§

§

impl<Node, Net, F, Fut, Pool> NetworkBuilder<Node, Pool> for F
where Node: FullNodeTypes, Net: FullNetwork, <Net as NetworkEventListenerProvider>::Primitives: NetPrimitivesFor<<<Node as FullNodeTypes>::Types as NodeTypes>::Primitives>, Pool: TransactionPool, F: Fn(&BuilderContext<Node>, Pool) -> Fut + Send, Fut: Future<Output = Result<Net, Report>> + Send,

§

type Network = Net