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 poll(
&mut self,
cx: &mut Context<'_>,
ctx: EngineHookContext,
) -> Poll<Result<EngineHookEvent, RethError>>
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
fn db_access_level(&self) -> EngineHookDBAccessLevel
Returns db access level the hook needs.