Skip to main content

DebugSnapshot

Struct DebugSnapshot 

Source
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: usize

The pc the program is stopped at (the op about to execute).

§op_text: String

The disassembled current op (empty once finished).

§narration: String

A 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: String

The 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: String

A 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: usize

Position in the execution history (0 = before any op) — the time-travel cursor.

§total_steps: usize

Highest step explored so far — the scrubber’s maximum (>= step).

§total_ops: usize

Number 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: bool

Whether execution is currently stopped on a breakpoint.

Trait Implementations§

Source§

impl Clone for DebugSnapshot

Source§

fn clone(&self) -> DebugSnapshot

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Serialize for DebugSnapshot

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,