Sigil documentation
ReferenceRust referencesigil-anomaly

sigil-anomaly · snapshot

Source declarations, signatures and documentation for snapshot.

Source: sigil/node/sigil-anomaly/src/snapshot.rs. SHA-256: 4a9c64ee1d2c1f8483a0b47a1c2322cc1e9017156148269ef18eb38f3c745be7.

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.

snapshot::SnapshotView

Immutable snapshot of a subset of chain state.

Rules access state only through this struct. The underlying map is keyed by application-defined string keys (e.g., "balance:did:...", "epoch:current"). Values are opaque byte strings; rules parse them according to the schema documented in their metadata.

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SnapshotView {

}

Source line: 23.

snapshot::SnapshotView::new

pub fn new(block_height: u64, block_hash: [u8; 32]) -> Self;

Source line: 32.

snapshot::SnapshotView::block_height

pub fn block_height(&self) -> u64;

Source line: 40.

snapshot::SnapshotView::block_hash

pub fn block_hash(&self) -> &[u8; 32];

Source line: 44.

snapshot::SnapshotView::insert

Insert a key-value pair into the view. Used by the validator-agent runtime when building a snapshot. Once the view is passed to a rule it is treated as immutable by the rule (the trait API takes &SnapshotView).

pub fn insert(&mut self, key: impl Into<String>, value: Vec<u8>);

Source line: 52.

snapshot::SnapshotView::get

Read a key from the view. Returns None if not present.

pub fn get(&self, key: &str) -> Option<&[u8]>;

Source line: 57.

snapshot::SnapshotView::len

Number of entries in the view.

pub fn len(&self) -> usize;

Source line: 62.

snapshot::SnapshotView::is_empty

pub fn is_empty(&self) -> bool;

Source line: 66.

snapshot::SnapshotView::contains_all

Check that all required keys are present. Used by RuleSet before invoking a rule whose metadata declares required keys.

pub fn contains_all(&self, required: &[String]) -> bool;

Source line: 72.

snapshot::SnapshotView::iter

Iterate over entries in deterministic order.

pub fn iter(&self) -> impl Iterator<Item = (&String, &Vec<u8>)>;

Source line: 77.

On this page