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 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: u8,
pub validation_bundle_id: u16,
pub compat_impact: u8,
pub migration_flags: u8,
pub had_failure: bool,
pub failed_error_code: u32,
pub failed_invariant_idx: u8,
pub failure_stage: u8,
}Expand description
Decoded receipt from wire bytes. Useful for CLI and off-chain tooling.
Fields§
§layout_id: [u8; 8]§changed_fields: u64§changed_bytes: u32§changed_regions: u16§old_size: u32§new_size: u32§invariants_checked: u16§was_resized: bool§invariants_passed: bool§cpi_invoked: bool§committed: bool§before_fingerprint: [u8; 8]§after_fingerprint: [u8; 8]§segment_changed_mask: u16§policy_flags: u32§journal_appends: u16§cpi_count: u8§phase: u8§validation_bundle_id: u16§compat_impact: u8§migration_flags: u8§had_failure: booltrue when the receipt records a failure (flags bit 4).
failed_error_code: u32User error code for the failing check, or 0 when no failure.
failed_invariant_idx: u8Invariant index for the failure, FAILED_INVARIANT_NONE (0xFF) when none.
failure_stage: u8Stage of execution at which the failure happened. See FailureStage.
Implementations§
Source§impl DecodedReceipt
impl DecodedReceipt
Sourcepub fn from_bytes(bytes: &[u8]) -> Option<DecodedReceipt>
pub fn from_bytes(bytes: &[u8]) -> Option<DecodedReceipt>
Decode a receipt from its 72-byte wire representation.
Accepts legacy 64-byte receipts for backwards compatibility:
when given exactly RECEIPT_SIZE_LEGACY bytes, the failure
payload fields are populated from the legacy flag bits and
otherwise left zeroed.
Returns None if the slice is shorter than the legacy size.
Sourcepub fn index_key(&self) -> [u8; 16]
pub fn index_key(&self) -> [u8; 16]
Deterministic index key: layout_id || after_fingerprint.
Indexers can combine this with the transaction signature/log index for a unique primary key while still grouping by layout and final state.
Sourcepub fn changed_field_count(&self) -> u16
pub fn changed_field_count(&self) -> u16
Number of changed fields recorded in the bitmask.
Sourcepub fn changed_segment_count(&self) -> u8
pub fn changed_segment_count(&self) -> u8
Number of changed segments recorded in the bitmask.
Sourcepub fn index_record(&self) -> ReceiptIndexRecord
pub fn index_record(&self) -> ReceiptIndexRecord
Project this receipt into a stable indexer row.
Sourcepub fn failure_stage_enum(&self) -> FailureStage
pub fn failure_stage_enum(&self) -> FailureStage
Resolve the failure_stage byte to a FailureStage enum.
Sourcepub fn has_changes(&self) -> bool
pub fn has_changes(&self) -> bool
Whether data actually changed according to this receipt.
Sourcepub fn fingerprint_changed(&self) -> bool
pub fn fingerprint_changed(&self) -> bool
Whether before/after fingerprints differ.
Sourcepub fn phase_enum(&self) -> Phase
pub fn phase_enum(&self) -> Phase
Resolve the phase byte to a Phase enum.
Sourcepub fn compat_impact_enum(&self) -> CompatImpact
pub fn compat_impact_enum(&self) -> CompatImpact
Resolve the compat_impact byte to a CompatImpact enum.
Sourcepub fn explain(&self) -> ReceiptExplain
pub fn explain(&self) -> ReceiptExplain
Return a structured human-readable explanation of this receipt.
This is the “operator UX” layer-every numeric field gets a semantic label so tools, dashboards, and CLI output can show meaningful text instead of raw bytes.