MutableTraceImpl
Fully qualified path: starkware_utils::trace::trace::MutableTraceImpl
pub impl MutableTraceImpl of MutableTraceTrait;
Impl 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::MutableTraceImpl::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 checkpointu128: 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::MutableTraceImpl::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::MutableTraceImpl::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::MutableTraceImpl::length
fn length(self: StoragePath<Mutable<Trace>>) -> u64
is_empty
Returns true is the trace is empty.
Fully qualified path: starkware_utils::trace::trace::MutableTraceImpl::is_empty
fn is_empty(self: StoragePath<Mutable<Trace>>) -> bool