pub trait EngineHook:
Send
+ Sync
+ 'static {
// Required methods
fn name(&self) -> &'static str;
fn poll(
&mut self,
cx: &mut Context<'_>,
ctx: EngineHookContext,
) -> Poll<RethResult<EngineHookEvent>>;
fn db_access_level(&self) -> EngineHookDBAccessLevel;
}
Expand description
Hook that will be run during the main loop of consensus engine.
Required Methods§
Sourcefn poll(
&mut self,
cx: &mut Context<'_>,
ctx: EngineHookContext,
) -> Poll<RethResult<EngineHookEvent>>
fn poll( &mut self, cx: &mut Context<'_>, ctx: EngineHookContext, ) -> Poll<RethResult<EngineHookEvent>>
Advances the hook execution, emitting an event.
Sourcefn db_access_level(&self) -> EngineHookDBAccessLevel
fn db_access_level(&self) -> EngineHookDBAccessLevel
Returns db access level the hook needs.