reth::consensus

Trait AsConsensus

Source
pub trait AsConsensus<H, B>: Consensus<H, B> {
    // Required method
    fn as_consensus<'a>(
        self: Arc<Self>,
    ) -> Arc<dyn Consensus<H, B, Error = Self::Error> + 'a>
       where Self: 'a;
}
Expand description

Helper trait to cast Arc<dyn FullConsensus> to Arc<dyn Consensus>

Required Methods§

Source

fn as_consensus<'a>( self: Arc<Self>, ) -> Arc<dyn Consensus<H, B, Error = Self::Error> + 'a>
where Self: 'a,

Converts the Arc of self to Arc of HeaderValidator

Implementors§

Source§

impl<T, H, B> AsConsensus<H, B> for T
where T: Consensus<H, B>,