Skip to main content

Store

Struct Store 

Source
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

Source

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.

Source

pub const fn def(&self) -> &Def

Source

pub const fn ident(&self) -> &'static str

Source

pub const fn store_name(&self) -> &'static str

Source

pub const fn canister(&self) -> &'static str

Source

pub const fn storage(&self) -> &StoreStorage

Borrow this store’s storage configuration.

Source

pub const fn is_stable_storage(&self) -> bool

Return whether this store is stable-memory-backed.

Source

pub const fn stable_memory_config(&self) -> Option<&StoreStableMemoryConfig>

Borrow stable-memory IDs when this store uses stable storage.

Source

pub const fn stable_data_memory_id(&self) -> u8

Source

pub const fn stable_index_memory_id(&self) -> u8

Source

pub const fn stable_schema_memory_id(&self) -> u8

Source

pub fn stable_data_allocation( &self, memory_namespace: &str, ) -> StableMemoryAllocation

Source

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.

Source

pub fn stable_index_allocation( &self, memory_namespace: &str, ) -> StableMemoryAllocation

Source

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.

Source

pub fn stable_schema_allocation( &self, memory_namespace: &str, ) -> StableMemoryAllocation

Source

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.

Source

pub fn stable_allocation( &self, memory_namespace: &str, role: StoreMemoryRole, ) -> StableMemoryAllocation

Trait Implementations§

Source§

impl Clone for Store

Source§

fn clone(&self) -> Store

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Store

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for Store

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.