pub struct AllocationSlotDescriptor { /* private fields */ }Expand description
AllocationSlotDescriptor
Encoded allocation slot persisted in the ledger.
Constructors for built-in substrates validate their invariants before a
descriptor can be used publicly. For MemoryManager slots, use
AllocationSlotDescriptor::memory_manager so ID 255 is rejected.
Implementations§
Source§impl AllocationSlotDescriptor
impl AllocationSlotDescriptor
Sourcepub const fn slot(&self) -> &AllocationSlot
pub const fn slot(&self) -> &AllocationSlot
Return the durable allocation slot value.
Sourcepub const fn descriptor_version(&self) -> u32
pub const fn descriptor_version(&self) -> u32
Return the descriptor encoding version.
Source§impl AllocationSlotDescriptor
impl AllocationSlotDescriptor
Sourcepub fn memory_manager(id: u8) -> Result<Self, MemoryManagerSlotError>
pub fn memory_manager(id: u8) -> Result<Self, MemoryManagerSlotError>
Construct a descriptor for a usable MemoryManager virtual memory ID.
ID 255 is the ic-stable-structures unallocated-bucket sentinel and is
rejected.
Sourcepub fn memory_manager_id(&self) -> Result<u8, MemoryManagerSlotError>
pub fn memory_manager_id(&self) -> Result<u8, MemoryManagerSlotError>
Return the usable MemoryManager virtual memory ID represented by this descriptor.
This validates substrate, descriptor version, slot kind, and sentinel ID rules before returning the numeric ID.
Trait Implementations§
Source§impl Clone for AllocationSlotDescriptor
impl Clone for AllocationSlotDescriptor
Source§fn clone(&self) -> AllocationSlotDescriptor
fn clone(&self) -> AllocationSlotDescriptor
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 AllocationSlotDescriptor
impl Debug for AllocationSlotDescriptor
Source§impl<'de> Deserialize<'de> for AllocationSlotDescriptor
impl<'de> Deserialize<'de> for AllocationSlotDescriptor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for AllocationSlotDescriptor
impl Hash for AllocationSlotDescriptor
Source§impl Ord for AllocationSlotDescriptor
impl Ord for AllocationSlotDescriptor
Source§fn cmp(&self, other: &AllocationSlotDescriptor) -> Ordering
fn cmp(&self, other: &AllocationSlotDescriptor) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for AllocationSlotDescriptor
impl PartialEq for AllocationSlotDescriptor
Source§fn eq(&self, other: &AllocationSlotDescriptor) -> bool
fn eq(&self, other: &AllocationSlotDescriptor) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for AllocationSlotDescriptor
impl PartialOrd for AllocationSlotDescriptor
Source§impl Serialize for AllocationSlotDescriptor
impl Serialize for AllocationSlotDescriptor
impl Eq for AllocationSlotDescriptor
impl StructuralPartialEq for AllocationSlotDescriptor
Auto Trait Implementations§
impl Freeze for AllocationSlotDescriptor
impl RefUnwindSafe for AllocationSlotDescriptor
impl Send for AllocationSlotDescriptor
impl Sync for AllocationSlotDescriptor
impl Unpin for AllocationSlotDescriptor
impl UnsafeUnpin for AllocationSlotDescriptor
impl UnwindSafe for AllocationSlotDescriptor
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