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>;
// Provided method
fn log_route_index(&self) -> Option<LogRouteIndex> { ... }
}Expand description
Pure synchronous handler for reactive inputs.
Required Methods§
Sourcefn interests(&self) -> Vec<ReactiveInterest<N>>
fn interests(&self) -> Vec<ReactiveInterest<N>>
Interests used by subscribers and the local router.
Sourcefn handle(
&self,
ctx: &ReactiveContext,
input: &ReactiveInput<N>,
state: &dyn StateView,
) -> Result<HandlerOutcome, HandlerError>
fn handle( &self, ctx: &ReactiveContext, input: &ReactiveInput<N>, state: &dyn StateView, ) -> Result<HandlerOutcome, HandlerError>
Handle one input against a read-only cache view.
Provided Methods§
Sourcefn log_route_index(&self) -> Option<LogRouteIndex>
fn log_route_index(&self) -> Option<LogRouteIndex>
Exhaustive exact keys for log inputs this handler can accept.
Returning None keeps the handler on the compatibility fallback path.
Returning an index promises that every matching log has at least one of
its keys; the registry still re-checks the handler’s original
LogInterests and local matchers before dispatch.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".