ic-backup 0.64.1

Host-side snapshot backup and same-release recovery for Internet Computer canisters
Documentation
//! Passive shared settlement claims; integrations own authentication and attribution.

use crate::model::artifacts::ArtifactChecksumRecord;

/// Original reservation identity and caller-qualified observation evidence.
/// Equality grants no freshness, authenticated outcome, spending or retry authority.
#[derive(Clone, Debug)]
pub struct SettlementContext {
    /// Full original operation authority and immutable allowance digest.
    pub authority: ArtifactChecksumRecord,
    /// Original pending mutation attempt.
    pub mutation_attempt: u32,
    /// Separately consumed pending observation attempt.
    pub observation_attempt: u32,
    /// Fresh caller-owned qualification challenge.
    pub challenge: ArtifactChecksumRecord,
    /// Exact evidence retained with the successful observation.
    pub observation_evidence: ArtifactChecksumRecord,
    /// Retained qualification binding every enclosing settlement field.
    pub evidence: ArtifactChecksumRecord,
}

/// Independently qualified attribution of one original lifecycle or data-write effect.
/// The enclosing settlement's method-specific validator retains its own requirements.
#[derive(Clone, Debug)]
pub enum EffectAttribution {
    /// Exclusive original-effect attribution. Loads require exact restored state;
    /// data writes require original-byte readback and stable destination custody.
    Applied {
        /// Excludes preexisting state and independent effects.
        attribution: ArtifactChecksumRecord,
    },
    /// The original effect never applied, including no transient application.
    NotApplied {
        /// Independently qualified exclusion; current state alone is insufficient.
        exclusion: ArtifactChecksumRecord,
    },
    /// A settled authenticated observation cannot resolve the original effect.
    Unresolved {
        /// Lost or unavailable replies never supply this settled uncertainty.
        uncertainty: ArtifactChecksumRecord,
    },
}