pub struct TraceStep {
pub pc: u64,
pub op: String,
pub gas: u64,
pub gas_cost: u64,
pub depth: u64,
pub stack: Vec<String>,
pub memory: Option<String>,
pub storage: Option<BTreeMap<String, String>>,
pub error: Option<String>,
pub snapshot: StepSnapshot,
}Fields§
§pc: u64§op: String§gas: u64§gas_cost: u64§depth: u64§stack: Vec<String>§memory: Option<String>§storage: Option<BTreeMap<String, String>>§error: Option<String>§snapshot: StepSnapshotImplementations§
Source§impl TraceStep
impl TraceStep
Sourcepub fn snapshot_ref(&self) -> StepSnapshotRef<'_>
pub fn snapshot_ref(&self) -> StepSnapshotRef<'_>
Borrows the machine state this step captured, without copying it.
A step records the same data twice: the flat stack/memory/storage fields, and
a StepSnapshot that additionally carries the storage diff. Whichever is
populated, this returns a view of it.
Prefer this over TraceStep::normalized_snapshot anywhere that walks a trace.
Traces routinely run to hundreds of thousands of steps and each one’s memory can
be tens of kilobytes, so copying per step — or, as variable decoding does, per
variable per step — dominates the cost of reading a trace.
Sourcepub fn normalized_snapshot(&self) -> StepSnapshot
pub fn normalized_snapshot(&self) -> StepSnapshot
Copies the machine state this step captured into an owned StepSnapshot.
Use this only when ownership is genuinely required; TraceStep::snapshot_ref is
the same view without the copy.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TraceStep
impl<'de> Deserialize<'de> for TraceStep
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TraceStep
impl StructuralPartialEq for TraceStep
Auto Trait Implementations§
impl Freeze for TraceStep
impl RefUnwindSafe for TraceStep
impl Send for TraceStep
impl Sync for TraceStep
impl Unpin for TraceStep
impl UnsafeUnpin for TraceStep
impl UnwindSafe for TraceStep
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
Mutably borrows from an owned value. Read more