Function moras::modules::riscv::middleware::backend_api::simulator_update

source ยท
pub fn simulator_update(
    simulator: &mut dyn Simulator,
    simulator_res: Optional,
    paused: bool,
) -> Result<(), String>
Expand description

Emits a simulator update event to the frontend.

  • simulator: Simulator instance to update its state.
  • simulator_res: Result of the simulator operation.

Returns Result indicating the success or failure of the event emission.

This function will emit a front_simulator_update event to the frontend, and the payload is a SimulatorData containing the current pc index, register and memory values.

SimulatorData:

  • filepath: string
  • success: bool
  • paused: bool
  • has_current_text: bool
  • current_text: u64
  • registers: Vec<Register>
  • data: Vec
  • message: string