pub struct StoreRegistry { /* private fields */ }Expand description
StoreRegistry
StoreRegistry owns the generated mapping from schema Store paths to their
row, index, and schema store handles.
It validates registration invariants once at generated wiring time and then
serves cheap immutable lookups during runtime operations.
Implementations§
Source§impl StoreRegistry
impl StoreRegistry
Sourcepub fn iter(&self) -> impl Iterator<Item = (&'static str, StoreHandle)>
pub fn iter(&self) -> impl Iterator<Item = (&'static str, StoreHandle)>
Iterate registered stores.
Iteration order follows registration order. Semantic result ordering must still not depend on this iteration order; callers that need deterministic ordering must sort by store path.
Sourcepub fn register_store(
&mut self,
name: &'static str,
data: &'static LocalKey<RefCell<DataStore>>,
index: &'static LocalKey<RefCell<IndexStore>>,
schema: &'static LocalKey<RefCell<SchemaStore>>,
allocations: StoreAllocationIdentities,
capabilities: StoreRuntimeStorageCapabilities,
) -> Result<(), InternalError>
pub fn register_store( &mut self, name: &'static str, data: &'static LocalKey<RefCell<DataStore>>, index: &'static LocalKey<RefCell<IndexStore>>, schema: &'static LocalKey<RefCell<SchemaStore>>, allocations: StoreAllocationIdentities, capabilities: StoreRuntimeStorageCapabilities, ) -> Result<(), InternalError>
Register a Store path to its row/index/schema store triplet with an
explicit allocation identity decision.
Generated stable-store wiring supplies stable allocation identities.
Tests and future non-stable stores must pass
StoreAllocationIdentities::absent explicitly when allocation
identities are intentionally unavailable.
Sourcepub fn register_journaled_store(
&mut self,
name: &'static str,
data: &'static LocalKey<RefCell<DataStore>>,
index: &'static LocalKey<RefCell<IndexStore>>,
schema: &'static LocalKey<RefCell<SchemaStore>>,
journal: &'static LocalKey<RefCell<JournalTailStore>>,
allocations: StoreAllocationIdentities,
capabilities: StoreRuntimeStorageCapabilities,
) -> Result<(), InternalError>
pub fn register_journaled_store( &mut self, name: &'static str, data: &'static LocalKey<RefCell<DataStore>>, index: &'static LocalKey<RefCell<IndexStore>>, schema: &'static LocalKey<RefCell<SchemaStore>>, journal: &'static LocalKey<RefCell<JournalTailStore>>, allocations: StoreAllocationIdentities, capabilities: StoreRuntimeStorageCapabilities, ) -> Result<(), InternalError>
Register one journaled store with its journal-tail storage handle.
Sourcepub fn try_get_store(&self, path: &str) -> Result<StoreHandle, InternalError>
pub fn try_get_store(&self, path: &str) -> Result<StoreHandle, InternalError>
Look up a store handle by path.