Skip to main content

DecodedReceipt

Struct DecodedReceipt 

Source
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: bool

true when the receipt records a failure (flags bit 4).

§failed_error_code: u32

User error code for the failing check, or 0 when no failure.

§failed_invariant_idx: u8

Invariant index for the failure, FAILED_INVARIANT_NONE (0xFF) when none.

§failure_stage: u8

Stage of execution at which the failure happened. See FailureStage.

Implementations§

Source§

impl DecodedReceipt

Source

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.

Source

pub fn failure_stage_enum(&self) -> FailureStage

Resolve the failure_stage byte to a FailureStage enum.

Source

pub fn has_changes(&self) -> bool

Whether data actually changed according to this receipt.

Source

pub fn fingerprint_changed(&self) -> bool

Whether before/after fingerprints differ.

Source

pub fn phase_enum(&self) -> Phase

Resolve the phase byte to a Phase enum.

Source

pub fn compat_impact_enum(&self) -> CompatImpact

Resolve the compat_impact byte to a CompatImpact enum.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.