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_checked(id: u8) -> Result<Self, MemoryManagerSlotError>
pub fn memory_manager_checked(id: u8) -> Result<Self, MemoryManagerSlotError>
Construct a descriptor for a usable MemoryManager virtual memory ID.
This is an explicit alias for AllocationSlotDescriptor::memory_manager.
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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
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,
Source§impl PartialEq for AllocationSlotDescriptor
impl PartialEq for AllocationSlotDescriptor
Source§fn eq(&self, other: &AllocationSlotDescriptor) -> bool
fn eq(&self, other: &AllocationSlotDescriptor) -> bool
self and other values to be equal, and is used by ==.