revm_interpreter/
instruction_context.rs

1use crate::{Interpreter, InterpreterTypes};
2
3/// Context passed to instruction implementations containing the host and interpreter.
4/// This struct provides access to both the host interface for external state operations
5/// and the interpreter state for stack, memory, and gas operations.
6pub struct InstructionContext<'a, H: ?Sized, ITy: InterpreterTypes> {
7    /// Reference to the interpreter containing execution state (stack, memory, gas, etc).
8    pub interpreter: &'a mut Interpreter<ITy>,
9    /// Reference to the host interface for accessing external blockchain state.
10    pub host: &'a mut H,
11}
12
13impl<H: ?Sized, ITy: InterpreterTypes> std::fmt::Debug for InstructionContext<'_, H, ITy> {
14    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15        f.debug_struct("InstructionContext")
16            .field("host", &"<host>")
17            .field("interpreter", &"<interpreter>")
18            .finish()
19    }
20}