pub struct Store { /* private fields */ }Expand description
Store
Schema node describing the storage mode for:
- primary entity data
- all index data for that entity
- schema metadata for that store
Implementations§
Source§impl Store
impl Store
Sourcepub const fn new_stable(
def: Def,
ident: &'static str,
store_name: &'static str,
canister: &'static str,
stable: StoreStableMemoryConfig,
) -> Self
pub const fn new_stable( def: Def, ident: &'static str, store_name: &'static str, canister: &'static str, stable: StoreStableMemoryConfig, ) -> Self
Build a stable-memory-backed store declaration.
This is the durable store constructor.
Sourcepub const fn new_heap(
def: Def,
ident: &'static str,
store_name: &'static str,
canister: &'static str,
heap: StoreHeapConfig,
) -> Self
pub const fn new_heap( def: Def, ident: &'static str, store_name: &'static str, canister: &'static str, heap: StoreHeapConfig, ) -> Self
Build a heap-backed volatile store declaration.
pub const fn def(&self) -> &Def
pub const fn ident(&self) -> &'static str
pub const fn store_name(&self) -> &'static str
pub const fn canister(&self) -> &'static str
Sourcepub const fn storage(&self) -> &StoreStorage
pub const fn storage(&self) -> &StoreStorage
Borrow this store’s storage configuration.
Sourcepub const fn is_stable_storage(&self) -> bool
pub const fn is_stable_storage(&self) -> bool
Return whether this store is stable-memory-backed.
Sourcepub const fn is_heap_storage(&self) -> bool
pub const fn is_heap_storage(&self) -> bool
Return whether this store is heap-backed and volatile.
Sourcepub const fn stable_memory_config(&self) -> Option<&StoreStableMemoryConfig>
pub const fn stable_memory_config(&self) -> Option<&StoreStableMemoryConfig>
Borrow stable-memory IDs when this store uses stable storage.
Sourcepub const fn storage_capabilities(&self) -> StoreStorageCapabilities
pub const fn storage_capabilities(&self) -> StoreStorageCapabilities
Return the capability descriptor derived from this store’s storage mode.
pub const fn stable_data_memory_id(&self) -> u8
pub const fn stable_index_memory_id(&self) -> u8
pub const fn stable_schema_memory_id(&self) -> u8
pub fn stable_data_allocation( &self, memory_namespace: &str, ) -> StableMemoryAllocation
Sourcepub fn stable_data_allocation_with_schema_metadata(
&self,
memory_namespace: &str,
schema_metadata: StableMemoryAllocationMetadata,
) -> StableMemoryAllocation
pub fn stable_data_allocation_with_schema_metadata( &self, memory_namespace: &str, schema_metadata: StableMemoryAllocationMetadata, ) -> StableMemoryAllocation
Build the data-memory allocation descriptor with accepted row-layout schema metadata attached for diagnostics.
pub fn stable_index_allocation( &self, memory_namespace: &str, ) -> StableMemoryAllocation
Sourcepub fn stable_index_allocation_with_schema_metadata(
&self,
memory_namespace: &str,
schema_metadata: StableMemoryAllocationMetadata,
) -> StableMemoryAllocation
pub fn stable_index_allocation_with_schema_metadata( &self, memory_namespace: &str, schema_metadata: StableMemoryAllocationMetadata, ) -> StableMemoryAllocation
Build the index-memory allocation descriptor with accepted index-catalog schema metadata attached for diagnostics.
pub fn stable_schema_allocation( &self, memory_namespace: &str, ) -> StableMemoryAllocation
Sourcepub fn stable_schema_allocation_with_schema_metadata(
&self,
memory_namespace: &str,
schema_metadata: StableMemoryAllocationMetadata,
) -> StableMemoryAllocation
pub fn stable_schema_allocation_with_schema_metadata( &self, memory_namespace: &str, schema_metadata: StableMemoryAllocationMetadata, ) -> StableMemoryAllocation
Build the schema-memory allocation descriptor with accepted catalog schema metadata attached for diagnostics.