Skip to main content

ReactiveHandler

Trait ReactiveHandler 

Source
pub trait ReactiveHandler<N: Network = Ethereum>: Send + Sync {
    // Required methods
    fn id(&self) -> HandlerId;
    fn interests(&self) -> Vec<ReactiveInterest<N>>;
    fn handle(
        &self,
        ctx: &ReactiveContext,
        input: &ReactiveInput<N>,
        state: &dyn StateView,
    ) -> Result<HandlerOutcome, HandlerError>;
}
Expand description

Pure synchronous handler for reactive inputs.

Required Methods§

Source

fn id(&self) -> HandlerId

Stable handler id.

Source

fn interests(&self) -> Vec<ReactiveInterest<N>>

Interests used by subscribers and the local router.

Source

fn handle( &self, ctx: &ReactiveContext, input: &ReactiveInput<N>, state: &dyn StateView, ) -> Result<HandlerOutcome, HandlerError>

Handle one input against a read-only cache view.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§