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 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: u64

Bitmask of field indices that changed. Up to 64 fields.

§changed_bytes: u32

Total changed bytes.

§changed_regions: u16

Number of disjoint changed regions.

§old_size: u32

Size before mutation.

§new_size: u32

Size after mutation.

§invariants_checked: u16

Number of invariants evaluated.

§was_resized: bool

Whether the account was reallocated.

§invariants_passed: bool

Whether all invariants passed.

§cpi_invoked: bool

Whether a CPI was invoked during this frame.

§committed: bool

Whether the frame was committed (false = rolled back / dry run).

§had_failure: bool

Whether 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: u16

Bitmask of segment indices touched (up to 16).

§policy_flags: u32

Policy flags bitmask.

§journal_appends: u16

Number of journal entries appended.

§cpi_count: u8

Count of CPIs.

§phase: Phase

Execution phase at which the receipt was sealed.

§validation_bundle_id: u16

Identifier of the validation bundle used.

§compat_impact: CompatImpact

Compatibility class of the mutation.

§migration_flags: u8

Bitmask of migration-related flags.

§failed_invariant_idx: u8

Invariant index for the failure (FAILED_INVARIANT_NONE when none).

§failed_error_code: u32

User error code for the failing check (0 when none).

§failure_stage: FailureStage

Stage at which the failure occurred.

Implementations§

Source§

impl DecodedReceipt

Source

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”.

Source

pub fn changed_field_indices(&self) -> ChangedFieldIter

Iterate the indices of fields that changed.

Source

pub fn changed_segment_indices(&self) -> ChangedSegmentIter

Iterate the indices of segments that were touched.

Source

pub const fn is_mutation(&self) -> bool

Whether any state was actually modified.

Source

pub const fn is_readonly(&self) -> bool

Whether this receipt is safe to treat as a read-through receipt.

Source

pub const fn size_delta(&self) -> i64

Size delta in bytes (post minus pre).

Trait Implementations§

Source§

impl Clone for DecodedReceipt

Source§

fn clone(&self) -> DecodedReceipt

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DecodedReceipt

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for DecodedReceipt

Source§

fn eq(&self, other: &DecodedReceipt) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for DecodedReceipt

Source§

impl Eq for DecodedReceipt

Source§

impl StructuralPartialEq for DecodedReceipt

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.