pub struct DecodedReceipt {Show 25 fields
pub layout_id: [u8; 8],
pub changed_fields: u64,
pub changed_bytes: u32,
pub changed_regions: u16,
pub old_size: u32,
pub new_size: u32,
pub invariants_checked: u16,
pub was_resized: bool,
pub invariants_passed: bool,
pub cpi_invoked: bool,
pub committed: bool,
pub had_failure: bool,
pub before_fingerprint: [u8; 8],
pub after_fingerprint: [u8; 8],
pub segment_changed_mask: u16,
pub policy_flags: u32,
pub journal_appends: u16,
pub cpi_count: u8,
pub phase: Phase,
pub validation_bundle_id: u16,
pub compat_impact: CompatImpact,
pub migration_flags: u8,
pub failed_invariant_idx: u8,
pub failed_error_code: u32,
pub failure_stage: FailureStage,
}Expand description
A fully decoded receipt in host-endian Rust types. Use this in indexers, receipt explorers, and receipt-aware UI.
Fields§
§layout_id: [u8; 8]Layout identifier of the account this receipt was produced for.
changed_fields: u64Bitmask of field indices that changed. Up to 64 fields.
changed_bytes: u32Total changed bytes.
changed_regions: u16Number of disjoint changed regions.
old_size: u32Size before mutation.
new_size: u32Size after mutation.
invariants_checked: u16Number of invariants evaluated.
was_resized: boolWhether the account was reallocated.
invariants_passed: boolWhether all invariants passed.
cpi_invoked: boolWhether a CPI was invoked during this frame.
committed: boolWhether the frame was committed (false = rolled back / dry run).
had_failure: boolWhether a failure was recorded (populates failed_* fields).
before_fingerprint: [u8; 8]Fingerprint of the pre-mutation state (8 bytes, mixer-derived).
after_fingerprint: [u8; 8]Fingerprint of the post-mutation state.
segment_changed_mask: u16Bitmask of segment indices touched (up to 16).
policy_flags: u32Policy flags bitmask.
journal_appends: u16Number of journal entries appended.
cpi_count: u8Count of CPIs.
phase: PhaseExecution phase at which the receipt was sealed.
validation_bundle_id: u16Identifier of the validation bundle used.
compat_impact: CompatImpactCompatibility class of the mutation.
migration_flags: u8Bitmask of migration-related flags.
failed_invariant_idx: u8Invariant index for the failure (FAILED_INVARIANT_NONE when none).
failed_error_code: u32User error code for the failing check (0 when none).
failure_stage: FailureStageStage at which the failure occurred.
Implementations§
Source§impl DecodedReceipt
impl DecodedReceipt
Sourcepub fn parse(buf: &[u8]) -> Result<Self, ReceiptError>
pub fn parse(buf: &[u8]) -> Result<Self, ReceiptError>
Parse a 72-byte wire receipt.
Accepts a 64-byte legacy receipt as a fallback: in that case the failure-payload fields default to “no failure recorded”.
Sourcepub fn changed_field_indices(&self) -> ChangedFieldIter ⓘ
pub fn changed_field_indices(&self) -> ChangedFieldIter ⓘ
Iterate the indices of fields that changed.
Sourcepub fn changed_segment_indices(&self) -> ChangedSegmentIter ⓘ
pub fn changed_segment_indices(&self) -> ChangedSegmentIter ⓘ
Iterate the indices of segments that were touched.
Sourcepub const fn is_mutation(&self) -> bool
pub const fn is_mutation(&self) -> bool
Whether any state was actually modified.
Sourcepub const fn is_readonly(&self) -> bool
pub const fn is_readonly(&self) -> bool
Whether this receipt is safe to treat as a read-through receipt.
Sourcepub const fn size_delta(&self) -> i64
pub const fn size_delta(&self) -> i64
Size delta in bytes (post minus pre).
Trait Implementations§
Source§impl Clone for DecodedReceipt
impl Clone for DecodedReceipt
Source§fn clone(&self) -> DecodedReceipt
fn clone(&self) -> DecodedReceipt
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DecodedReceipt
impl Debug for DecodedReceipt
Source§impl PartialEq for DecodedReceipt
impl PartialEq for DecodedReceipt
Source§fn eq(&self, other: &DecodedReceipt) -> bool
fn eq(&self, other: &DecodedReceipt) -> bool
self and other values to be equal, and is used by ==.