Sigil documentation
ReferenceRust referencesigil-anomaly

sigil-anomaly · error

Source declarations, signatures and documentation for error.

Source: sigil/node/sigil-anomaly/src/error.rs. SHA-256: 5abb31a2207ecb6278087daf7214b03c9b881307188e2d248c1a10676b0894ec.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

error::AnomalyError

#[derive(Debug, Error, Clone, PartialEq, Eq)]
pub enum AnomalyError {
    /// A rule attempted to read state outside the supplied snapshot view.
    /// This is a programming error in the rule, not a runtime condition.
    #[error("rule {rule_id} attempted live state read; rules must use the supplied snapshot view")]
    LiveStateRead { rule_id: String },

    /// A rule's serialized definition does not match the declared content
    /// address (BLAKE3 mismatch). Rejected at registration.
    #[error("rule code blob hash mismatch: declared {declared}, computed {computed}")]
    CodeBlobHashMismatch { declared: String, computed: String },

    /// A rule requested a schema version not supported by this crate build.
    #[error("rule schema version {requested} not supported (this build supports {supported})")]
    SchemaVersionMismatch { requested: u32, supported: u32 },

    /// A rule emitted output that failed deterministic-canonical-form
    /// checks. Surfaced to the caller as a programming error.
    #[error("rule {rule_id} emitted non-canonical output: {detail}")]
    NonCanonicalOutput { rule_id: String, detail: String },

    /// A rule failed while evaluating a transaction. The `RuleSet` turns
    /// this into a critical invariant flag rather than silently skipping it.
    #[error("rule {rule_id} evaluation failed: {detail}")]
    RuleEvaluationFailed { rule_id: String, detail: String },

    /// Two rules registered under the same id. Registration is rejected.
    #[error("rule id {0} is already registered")]
    DuplicateRuleId(String),

    /// A rule set was not loaded from a content-addressed source.
    #[error("invalid rule-set provenance: {0}")]
    InvalidRuleSetProvenance(String),

    /// Snapshot view did not contain a key the rule asserted as
    /// required. Rules must declare required keys at registration.
    #[error("rule {rule_id} required snapshot key {key} not present in view")]
    MissingSnapshotKey { rule_id: String, key: String },
}

Source line: 10.

error::Result

pub type Result<T> = std::result::Result<T, AnomalyError>;

Source line: 49.

On this page