Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

MutableTraceTrait

Fully qualified path: starkware_utils::trace::trace::MutableTraceTrait

pub trait MutableTraceTrait

Trait functions

insert

Inserts a (key, value) pair into a Trace so that it is stored as the checkpoint, either by inserting a new checkpoint, or by updating the last one.

Fully qualified path: starkware_utils::trace::trace::MutableTraceTrait::insert

fn insert(self: StoragePath<Mutable<Trace>>, key: u64, value: u128)

latest

Retrieves the most recent checkpoint from the trace structure.

Returns

A tuple containing:

  • u64: Timestamp/key of the latest checkpoint
  • u128: Value stored in the latest checkpoint

Panics

If the trace structure is empty (no checkpoints exist)

Note

This will return the last inserted checkpoint that maintains the structure’s invariant of non-decreasing keys.

Fully qualified path: starkware_utils::trace::trace::MutableTraceTrait::latest

fn latest(self: StoragePath<Mutable<Trace>>) -> Result<(u64, u128), TraceErrors>

penultimate

Retrieves the penultimate checkpoint from the trace structure. Penultimate checkpoint is the second last checkpoint in the trace.

Fully qualified path: starkware_utils::trace::trace::MutableTraceTrait::penultimate

fn penultimate(self: StoragePath<Mutable<Trace>>) -> Result<(u64, u128), TraceErrors>

length

Returns the total number of checkpoints.

Fully qualified path: starkware_utils::trace::trace::MutableTraceTrait::length

fn length(self: StoragePath<Mutable<Trace>>) -> u64

is_empty

Returns true is the trace is empty.

Fully qualified path: starkware_utils::trace::trace::MutableTraceTrait::is_empty

fn is_empty(self: StoragePath<Mutable<Trace>>) -> bool