Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

TraceTrait

Fully qualified path: starkware_utils::trace::trace::TraceTrait

pub trait TraceTrait

Trait functions

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::TraceTrait::latest

fn latest(self: StoragePath<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::TraceTrait::penultimate

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

length

Returns the total number of checkpoints.

Fully qualified path: starkware_utils::trace::trace::TraceTrait::length

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

at

Returns the checkpoint at the given position.

Returns

A tuple containing:

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

Panics

If the position is out of bounds.

Fully qualified path: starkware_utils::trace::trace::TraceTrait::at

fn at(self: StoragePath<Trace>, pos: u64) -> (u64, u128)

is_empty

Returns true is the trace is empty.

Fully qualified path: starkware_utils::trace::trace::TraceTrait::is_empty

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