reth::beacon_consensus::hooks

Trait EngineHook

pub trait EngineHook:
    Send
    + Sync
    + 'static {
    // Required methods
    fn name(&self) -> &'static str;
    fn poll(
        &mut self,
        cx: &mut Context<'_>,
        ctx: EngineHookContext,
    ) -> Poll<Result<EngineHookEvent, RethError>>;
    fn db_access_level(&self) -> EngineHookDBAccessLevel;
}
Expand description

Hook that will be run during the main loop of consensus engine.

Required Methods§

fn name(&self) -> &'static str

Returns a human-readable name for the hook.

fn poll( &mut self, cx: &mut Context<'_>, ctx: EngineHookContext, ) -> Poll<Result<EngineHookEvent, RethError>>

Advances the hook execution, emitting an event.

fn db_access_level(&self) -> EngineHookDBAccessLevel

Returns db access level the hook needs.

Implementors§