pub struct MemoryRegistry;Expand description
MemoryRegistry
Canonical substrate registry for stable memory IDs.
Implementations§
Source§impl MemoryRegistry
impl MemoryRegistry
Sourcepub fn reserve_range(
crate_name: &str,
start: u8,
end: u8,
) -> Result<(), MemoryRegistryError>
pub fn reserve_range( crate_name: &str, start: u8, end: u8, ) -> Result<(), MemoryRegistryError>
Reserve a memory range for a crate.
Sourcepub fn register(
id: u8,
crate_name: &str,
label: &str,
) -> Result<(), MemoryRegistryError>
pub fn register( id: u8, crate_name: &str, label: &str, ) -> Result<(), MemoryRegistryError>
Register a memory ID.
Sourcepub fn export() -> Vec<(u8, MemoryRegistryEntry)>
pub fn export() -> Vec<(u8, MemoryRegistryEntry)>
Export all registered entries (canonical snapshot).
Sourcepub fn export_ranges() -> Vec<(String, MemoryRange)>
pub fn export_ranges() -> Vec<(String, MemoryRange)>
Export all reserved ranges.
Sourcepub fn get(id: u8) -> Option<MemoryRegistryEntry>
pub fn get(id: u8) -> Option<MemoryRegistryEntry>
Retrieve a single registry entry.
Auto Trait Implementations§
impl Freeze for MemoryRegistry
impl RefUnwindSafe for MemoryRegistry
impl Send for MemoryRegistry
impl Sync for MemoryRegistry
impl Unpin for MemoryRegistry
impl UnwindSafe for MemoryRegistry
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