pub struct HostRef<'a, H: Host + ?Sized, ITy: InterpreterTypes> {
pub host: &'a mut H,
pub interp: &'a mut Interpreter<ITy>,
}
Add this structure and replace instruction signature from:
pub fn jump<WIRE: InterpreterTypes, H: Host + ?Sized>(
interpreter: &mut Interpreter<WIRE>,
_host: &mut H,
) {
To this:
pub fn jump<ITy: InterpreterTypes, H: Host + ?Sized>(
context: &mut InstructionContext<'_, ITy, H>,
) {
This would require many line changes, but encapsulating types in InstructionContext would allow adding more types inside or moving SharedMemory from Interpreter to InstructionContext. Another interesting question would be whether this affects performance in any way.