reth_node_builder::components

Trait ConsensusBuilder

Source
pub trait ConsensusBuilder<Node: FullNodeTypes>: Send {
    type Consensus: FullConsensus<<Node::Types as NodeTypes>::Primitives> + Clone + Unpin + 'static;

    // Required method
    fn build_consensus(
        self,
        ctx: &BuilderContext<Node>,
    ) -> impl Future<Output = Result<Self::Consensus>> + Send;
}
Expand description

A type that knows how to build the consensus implementation.

Required Associated Types§

Source

type Consensus: FullConsensus<<Node::Types as NodeTypes>::Primitives> + Clone + Unpin + 'static

The consensus implementation to build.

Required Methods§

Source

fn build_consensus( self, ctx: &BuilderContext<Node>, ) -> impl Future<Output = Result<Self::Consensus>> + Send

Creates the consensus implementation.

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<Node, F, Fut, Consensus> ConsensusBuilder<Node> for F
where Node: FullNodeTypes, Consensus: FullConsensus<<Node::Types as NodeTypes>::Primitives> + Clone + Unpin + 'static, F: FnOnce(&BuilderContext<Node>) -> Fut + Send, Fut: Future<Output = Result<Consensus>> + Send,

Source§

type Consensus = Consensus