pub struct DebugSnapshot {Show 17 fields
pub pc: usize,
pub op_text: String,
pub narration: String,
pub fol: String,
pub socratic: String,
pub op_reads: Vec<u16>,
pub op_writes: Option<u16>,
pub state: String,
pub error: Option<String>,
pub step: usize,
pub total_steps: usize,
pub total_ops: usize,
pub frames: Vec<DebugFrame>,
pub heap: Vec<HeapObject>,
pub globals: Vec<(String, String)>,
pub output: Vec<String>,
pub at_breakpoint: bool,
}Expand description
A complete picture of the paused VM for the debug drawer (serde for the UI).
Fields§
§pc: usizeThe pc the program is stopped at (the op about to execute).
op_text: StringThe disassembled current op (empty once finished).
narration: StringA plain-English description of the op about to run — the teaching narration (e.g. “add x(6) + y(7) → R4”). Empty for the long-tail ops.
fol: StringThe first-order-logic semantics of the op about to run — the formal meaning of
this step (e.g. sum = x + y, t ⟺ (i < n), ¬cond → goto 12). Empty for the
long-tail ops.
socratic: StringA Socratic prompt for the step about to run — a guiding question that invites
the learner to predict the outcome before stepping (“x (6) and y (7) — what is
their sum?”). Empty for ops with nothing to anticipate (the UI then shows the
plain narration). Matches the engine’s voice: concrete values, second person, —.
op_reads: Vec<u16>Registers the current op reads / writes — drives the datapath animation.
op_writes: Option<u16>§state: String"paused" | "done" | "blocked" | "error".
error: Option<String>§step: usizePosition in the execution history (0 = before any op) — the time-travel cursor.
total_steps: usizeHighest step explored so far — the scrubber’s maximum (>= step).
total_ops: usizeNumber of instructions in the program (the bytecode tape length).
frames: Vec<DebugFrame>Call frames, Main first and the current frame last.
heap: Vec<HeapObject>Heap objects reachable from the current frame + globals (the Heap view).
globals: Vec<(String, String)>Promoted globals (name → display value).
output: Vec<String>Output emitted so far (the Show lines).
at_breakpoint: boolWhether execution is currently stopped on a breakpoint.
Trait Implementations§
Source§impl Clone for DebugSnapshot
impl Clone for DebugSnapshot
Source§fn clone(&self) -> DebugSnapshot
fn clone(&self) -> DebugSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DebugSnapshot
impl RefUnwindSafe for DebugSnapshot
impl Send for DebugSnapshot
impl Sync for DebugSnapshot
impl Unpin for DebugSnapshot
impl UnsafeUnpin for DebugSnapshot
impl UnwindSafe for DebugSnapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.