pub struct StepSnapshot {
pub stack: Vec<Word>,
pub memory: Option<Arc<str>>,
pub storage: Arc<BTreeMap<String, String>>,
pub storage_diff: BTreeMap<String, StorageChange>,
pub transient_storage: BTreeMap<String, String>,
pub return_data: Option<Arc<str>>,
}Expand description
The machine state one step captured.
memory and storage are shared: a backend building steps hands the previous step’s
value on unchanged, so a trace holds one copy of memory per change rather than one
per step. Reads see plain values through Deref; a step that changes them gets its
own.
Fields§
§stack: Vec<Word>§memory: Option<Arc<str>>Memory as one unprefixed hex string.
storage: Arc<BTreeMap<String, String>>§storage_diff: BTreeMap<String, StorageChange>§transient_storage: BTreeMap<String, String>The transient slots this step read or wrote, with their value after it.
return_data: Option<Arc<str>>The return data buffer before this step, as unprefixed hex; None when empty.
Implementations§
Source§impl StepSnapshot
impl StepSnapshot
Sourcepub fn new(
stack: Vec<Word>,
memory: Option<String>,
storage: BTreeMap<String, String>,
storage_diff: BTreeMap<String, StorageChange>,
) -> Self
pub fn new( stack: Vec<Word>, memory: Option<String>, storage: BTreeMap<String, String>, storage_diff: BTreeMap<String, StorageChange>, ) -> Self
A snapshot that owns its values, for a backend or a test building one from parts.
Sourcepub fn with_transient_storage(
self,
transient_storage: BTreeMap<String, String>,
) -> Self
pub fn with_transient_storage( self, transient_storage: BTreeMap<String, String>, ) -> Self
The same snapshot with transient_storage set.
Sourcepub fn with_return_data(self, return_data: Option<String>) -> Self
pub fn with_return_data(self, return_data: Option<String>) -> Self
The same snapshot with return_data set; empty data is stored as None.
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for StepSnapshot
impl Clone for StepSnapshot
Source§impl Debug for StepSnapshot
impl Debug for StepSnapshot
Source§impl Default for StepSnapshot
impl Default for StepSnapshot
Source§impl<'de> Deserialize<'de> for StepSnapshot
impl<'de> Deserialize<'de> for StepSnapshot
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 StepSnapshot
Source§impl PartialEq for StepSnapshot
impl PartialEq for StepSnapshot
Source§impl Serialize for StepSnapshot
impl Serialize for StepSnapshot
impl StructuralPartialEq for StepSnapshot
Auto Trait Implementations§
impl Freeze for StepSnapshot
impl RefUnwindSafe for StepSnapshot
impl Send for StepSnapshot
impl Sync for StepSnapshot
impl Unpin for StepSnapshot
impl UnsafeUnpin for StepSnapshot
impl UnwindSafe for StepSnapshot
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