Expand description
Handler traits and types for the expression evaluator.
This module defines the handler traits that allow the expression evaluator to interact with different data sources and execution contexts. The handler pattern enables flexible evaluation of Solidity-like expressions against various backends such as debug snapshots, EVM state, or simulation environments.
§Handler Types
VariableHandler- Resolves variable values by nameMappingArrayHandler- Handles mapping and array access operationsFunctionCallHandler- Executes function calls and built-in functionsMemberAccessHandler- Resolves member access on values (e.g., struct fields)MsgHandler- Provides transaction context (msg.sender,msg.value)TxHandler- Provides transaction globals (tx.origin)BlockHandler- Provides block context (block.number,block.timestamp)ValidationHandler- Validates final expression results
§Usage
Handlers are typically used through EvaluatorHandlers, which aggregates
all handler types and can be configured with different implementations:
ⓘ
let handlers = EvaluatorHandlers::new()
.with_variable_handler(Box::new(my_variable_handler))
.with_function_call_handler(Box::new(my_function_handler));Modules§
- debug
- Debug handler implementations for testing and simulation Debug handler implementations for testing and simulation.
- edb
- EDB handler implementations for real debug snapshots EDB handler implementations for the expression evaluator.
Structs§
- Evaluator
Handlers - Combined handlers struct for the expression evaluator.
Traits§
- Block
Handler - Handler trait for
blockglobal variables. - Function
Call Handler - Handler trait for function calls and built-in functions.
- Mapping
Array Handler - Handler trait for mapping and array access operations.
- Member
Access Handler - Handler trait for member access operations.
- MsgHandler
- Handler trait for
msgglobal variables. - TxHandler
- Handler trait for
txglobal variables. - Validation
Handler - Handler trait for final expression validation.
- Variable
Handler - Handler trait for variable value resolution.