pub struct Store { /* private fields */ }Expand description
Store
Schema node describing stable IC BTreeMap memories that store:
- primary entity data
- all index data for that entity
- persisted 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 only implemented store constructor in 0.167.
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 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.
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.
pub fn stable_allocation( &self, memory_namespace: &str, role: StoreMemoryRole, ) -> StableMemoryAllocation
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Store
impl RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl UnsafeUnpin for Store
impl UnwindSafe for Store
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more