Skip to main content

ReceiptExplain

Struct ReceiptExplain 

Source
pub struct ReceiptExplain {
    pub phase_name: &'static str,
    pub compat_label: &'static str,
    pub policy_name: &'static str,
    pub mutation_summary: &'static str,
    pub integrity_summary: &'static str,
    pub cpi_summary: &'static str,
    pub changed_field_count: u16,
    pub segment_count: u8,
    pub fingerprint_changed: bool,
    pub segment_role_names: [&'static str; 8],
    pub segment_role_count: u8,
}
Expand description

Human-readable explanation of a decoded receipt.

Produced by DecodedReceipt::explain(). Every field is a semantic label, not a raw number-designed for operator dashboards, CLI output, and audit logs.

Fields§

§phase_name: &'static str

Phase name (“Update”, “Init”, “Close”, “Migrate”, “ReadOnly”).

§compat_label: &'static str

Compatibility impact label (“None”, “Append”, “Migration”, “Breaking”).

§policy_name: &'static str

Policy pack name that governed this instruction (“unknown” when not embedded).

§mutation_summary: &'static str

One-sentence description of what mutation occurred.

§integrity_summary: &'static str

One-sentence description of invariant check result.

§cpi_summary: &'static str

One-sentence CPI summary.

§changed_field_count: u16

Number of individual fields changed (popcount of changed_fields mask).

§segment_count: u8

Number of segments that were modified.

§fingerprint_changed: bool

Whether the before/after fingerprints differ.

§segment_role_names: [&'static str; 8]

Role names for modified segments (up to 8). Use segment_role_count to know how many entries are valid.

§segment_role_count: u8

Number of valid entries in segment_role_names.

Implementations§

Source§

impl ReceiptExplain

Source

pub const fn with_policy_name(self, name: &'static str) -> ReceiptExplain

Return a copy with the given policy name injected.

The receipt wire format does not carry the policy pack name-only a bitmask of flags. Call this after constructing an explain from the decoded receipt when you know which policy pack governed the instruction (e.g. from the program manifest).

Source

pub const fn with_segment_role( self, idx: u8, name: &'static str, ) -> ReceiptExplain

Inject a segment role name at the given index.

Call once per modified segment, using the SegmentRole::name() output for each bit set in segment_changed_mask. This enriches the explain with human-readable role labels.

Source

pub const fn summary(&self) -> &'static str

One-line human-readable summary combining phase, mutation, and integrity status.

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.