pub struct StableMemoryAllocation { /* private fields */ }Expand description
Stable-memory allocation descriptor.
memory_id + stable_key is the durable allocation identity.
schema_version + schema_fingerprint is diagnostic metadata only.
Implementations§
Source§impl StableMemoryAllocation
impl StableMemoryAllocation
Sourcepub const fn without_schema_metadata(memory_id: u8, stable_key: String) -> Self
pub const fn without_schema_metadata(memory_id: u8, stable_key: String) -> Self
Build an allocation descriptor without schema metadata.
Sourcepub const fn with_schema_metadata(
memory_id: u8,
stable_key: String,
schema_metadata: StableMemoryAllocationMetadata,
) -> Self
pub const fn with_schema_metadata( memory_id: u8, stable_key: String, schema_metadata: StableMemoryAllocationMetadata, ) -> Self
Build an allocation descriptor with diagnostic schema metadata.
The metadata must come from accepted schema/catalog authority. Generated model fallback metadata is not an allocation metadata authority.
Sourcepub const fn stable_key(&self) -> &str
pub const fn stable_key(&self) -> &str
Durable stable-memory key.
Sourcepub const fn schema_metadata(&self) -> &StableMemoryAllocationMetadata
pub const fn schema_metadata(&self) -> &StableMemoryAllocationMetadata
Diagnostic schema/catalog metadata.
Sourcepub const fn schema_version(&self) -> Option<u32>
pub const fn schema_version(&self) -> Option<u32>
Accepted schema/catalog version, when known.
Sourcepub const fn schema_fingerprint(&self) -> Option<&str>
pub const fn schema_fingerprint(&self) -> Option<&str>
Accepted schema/catalog fingerprint, when known.
Sourcepub fn same_identity_as(&self, other: &Self) -> bool
pub fn same_identity_as(&self, other: &Self) -> bool
Compare durable allocation identity only.
Schema metadata is intentionally ignored because metadata changes are diagnostics, not memory replacement.
Trait Implementations§
Source§impl Clone for StableMemoryAllocation
impl Clone for StableMemoryAllocation
Source§fn clone(&self) -> StableMemoryAllocation
fn clone(&self) -> StableMemoryAllocation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StableMemoryAllocation
impl Debug for StableMemoryAllocation
Source§impl PartialEq for StableMemoryAllocation
impl PartialEq for StableMemoryAllocation
Source§fn eq(&self, other: &StableMemoryAllocation) -> bool
fn eq(&self, other: &StableMemoryAllocation) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for StableMemoryAllocation
impl StructuralPartialEq for StableMemoryAllocation
Auto Trait Implementations§
impl Freeze for StableMemoryAllocation
impl RefUnwindSafe for StableMemoryAllocation
impl Send for StableMemoryAllocation
impl Sync for StableMemoryAllocation
impl Unpin for StableMemoryAllocation
impl UnsafeUnpin for StableMemoryAllocation
impl UnwindSafe for StableMemoryAllocation
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