sigil-storage · gal_storage
Source declarations, signatures and documentation for gal_storage.
Source: sigil/node/sigil-storage/src/gal_storage.rs. SHA-256: 6810035a31351cf29b97d6d24a7fd7f5b84b9c4d06abe89e5c9a3cca7a621481.
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.
gal_storage::PARTITION_HMR
Partition: latest [HmrAnchor] per HMR DID.
pub const PARTITION_HMR: &str;Source line: 18.
gal_storage::PARTITION_MHR
Partition: latest [MhrAnchor] per MHR DID.
pub const PARTITION_MHR: &str;Source line: 20.
gal_storage::PARTITION_ENR
Partition: latest [EnrAnchor] per ENR DID.
pub const PARTITION_ENR: &str;Source line: 22.
gal_storage::PARTITION_ORG_ROOT
Partition: latest [OrgLineageRoot] per org DID.
pub const PARTITION_ORG_ROOT: &str;Source line: 24.
gal_storage::PARTITION_SHARD_ASSIGNMENT
Partition: latest [ShardAssignment] per subject DID.
pub const PARTITION_SHARD_ASSIGNMENT: &str;Source line: 26.
gal_storage::PARTITION_REVOCATION
Partition: revocation records keyed by subject DID.
pub const PARTITION_REVOCATION: &str;Source line: 28.
gal_storage::PARTITION_SHARD_TOPOLOGY
Partition: append-only [ShardTopologyEntry] log.
Keys are zero-padded applied_at_block:sequence so prefix scans
produce a chronological ordering.
pub const PARTITION_SHARD_TOPOLOGY: &str;Source line: 32.
gal_storage::PARTITIONS
All GAL partitions, in canonical iteration order. Useful when wiring storage backends that need to declare column families up front.
pub const PARTITIONS: &[&str];Source line: 36.
gal_storage::key_for_did
Encode a DID as the canonical key for per-subject partitions (HMR / MHR / ENR / org-root / shard-assignment / revocation).
pub fn key_for_did(did: &str) -> Vec<u8>;Source line: 48.
gal_storage::topology_key
Encode a topology key from applied_at_block + per-block sequence.
Produces 16 bytes: 8 BE bytes for the block, 8 BE bytes for the
sequence — so prefix-scanning yields chronological order.
pub fn topology_key(applied_at_block: u64, sequence: u64) -> Vec<u8>;Source line: 55.
gal_storage::write
Typed write helpers. Each accepts the appropriate record type from
sigil-core::gal (passed as &T to keep this module loosely coupled).
pub mod write;Source line: 96.
gal_storage::write::put_hmr
Store the latest HMR anchor for a DID. Existing entries are overwritten — call sites are responsible for monotonic-sequence enforcement.
pub fn put_hmr<T: Serialize>(
store: &dyn StateStore,
did: &str,
record: &T,
) -> Result<(), StorageError>;Source line: 102.
gal_storage::write::put_mhr
Store the latest MHR anchor for a DID.
pub fn put_mhr<T: Serialize>(
store: &dyn StateStore,
did: &str,
record: &T,
) -> Result<(), StorageError>;Source line: 111.
gal_storage::write::put_enr
Store the latest ENR anchor for a DID.
pub fn put_enr<T: Serialize>(
store: &dyn StateStore,
did: &str,
record: &T,
) -> Result<(), StorageError>;Source line: 120.
gal_storage::write::put_org_root
Store the latest org lineage root for an org DID.
pub fn put_org_root<T: Serialize>(
store: &dyn StateStore,
org_did: &str,
record: &T,
) -> Result<(), StorageError>;Source line: 129.
gal_storage::write::put_shard_assignment
Store the current shard assignment for a subject DID.
pub fn put_shard_assignment<T: Serialize>(
store: &dyn StateStore,
subject_did: &str,
record: &T,
) -> Result<(), StorageError>;Source line: 138.
gal_storage::write::put_revocation
Store a revocation record for a subject DID. Cascade revocations
should use [super::cascade_revoke] for atomic multi-write
semantics.
pub fn put_revocation<T: Serialize>(
store: &dyn StateStore,
subject_did: &str,
record: &T,
) -> Result<(), StorageError>;Source line: 154.
gal_storage::write::append_shard_topology
Append a shard-topology entry under a chronological key.
pub fn append_shard_topology<T: Serialize>(
store: &dyn StateStore,
applied_at_block: u64,
sequence: u64,
record: &T,
) -> Result<(), StorageError>;Source line: 168.
gal_storage::read
Typed read helpers, generic over the record type. Higher layers pass
sigil-core::gal::HmrAnchor (etc.) directly.
pub mod read;Source line: 185.
gal_storage::read::get_hmr
Fetch the latest HMR record for a DID.
pub fn get_hmr<T: DeserializeOwned>(
store: &dyn StateStore,
did: &str,
) -> Result<Option<T>, StorageError>;Source line: 189.
gal_storage::read::get_mhr
Fetch the latest MHR record for a DID.
pub fn get_mhr<T: DeserializeOwned>(
store: &dyn StateStore,
did: &str,
) -> Result<Option<T>, StorageError>;Source line: 197.
gal_storage::read::get_enr
Fetch the latest ENR record for a DID.
pub fn get_enr<T: DeserializeOwned>(
store: &dyn StateStore,
did: &str,
) -> Result<Option<T>, StorageError>;Source line: 205.
gal_storage::read::get_org_root
Fetch the latest org lineage root for an org DID.
pub fn get_org_root<T: DeserializeOwned>(
store: &dyn StateStore,
org_did: &str,
) -> Result<Option<T>, StorageError>;Source line: 213.
gal_storage::read::get_shard_assignment
Fetch the current shard assignment for a subject DID.
pub fn get_shard_assignment<T: DeserializeOwned>(
store: &dyn StateStore,
subject_did: &str,
) -> Result<Option<T>, StorageError>;Source line: 221.
gal_storage::read::get_revocation
Fetch the revocation record for a subject DID, or None if the
subject is not revoked.
pub fn get_revocation<T: DeserializeOwned>(
store: &dyn StateStore,
subject_did: &str,
) -> Result<Option<T>, StorageError>;Source line: 230.
gal_storage::read::is_revoked
Returns true if subject_did has any revocation record.
pub fn is_revoked(store: &dyn StateStore, subject_did: &str) -> Result<bool, StorageError>;Source line: 238.
gal_storage::cascade_revoke
Apply a cascade revocation across multiple DIDs as one logical write.
Backends with a native batch primitive implement this as a crash-atomic write; simpler stores apply the entries while holding their store lock.
pub fn cascade_revoke<T: Serialize>(
store: &dyn StateStore,
subject_dids: &[&str],
record_for: impl Fn(&str) -> T,
) -> Result<(), StorageError>;Source line: 247.