pub struct MemoryApi;Expand description
MemoryApi
Supported facade for memory bootstrap, dynamic slot registration, and registry inspection.
Implementations§
Source§impl MemoryApi
impl MemoryApi
Sourcepub fn bootstrap_owner_range(
crate_name: &'static str,
start: u8,
end: u8,
) -> Result<(), MemoryRegistryError>
pub fn bootstrap_owner_range( crate_name: &'static str, start: u8, end: u8, ) -> Result<(), MemoryRegistryError>
Bootstrap eager TLS, eager-init hooks, and the caller’s initial reserved range.
Sourcepub fn bootstrap_pending() -> Result<(), MemoryRegistryError>
pub fn bootstrap_pending() -> Result<(), MemoryRegistryError>
Bootstrap eager TLS, eager-init hooks, and flush deferred registry state without reserving a new owner range.
Sourcepub fn declare(
id: u8,
crate_name: &str,
label: &str,
) -> Result<(), MemoryRegistryError>
pub fn declare( id: u8, crate_name: &str, label: &str, ) -> Result<(), MemoryRegistryError>
Declare one legacy-key stable-memory ID for bootstrap validation.
This queues metadata only. It does not open the underlying virtual memory.
Sourcepub fn declare_with_key(
id: u8,
crate_name: &str,
label: &str,
stable_key: &str,
) -> Result<(), MemoryRegistryError>
pub fn declare_with_key( id: u8, crate_name: &str, label: &str, stable_key: &str, ) -> Result<(), MemoryRegistryError>
Declare one explicit-key stable-memory ID for bootstrap validation.
This queues metadata only. It does not open the underlying virtual memory.
Sourcepub fn register(
id: u8,
crate_name: &str,
label: &str,
) -> Result<VirtualMemory<DefaultMemoryImpl>, MemoryRegistryError>
pub fn register( id: u8, crate_name: &str, label: &str, ) -> Result<VirtualMemory<DefaultMemoryImpl>, MemoryRegistryError>
Open one already-validated stable-memory ID and return its virtual memory handle.
The ID must have been declared before bootstrap and accepted by the sealed runtime declaration snapshot. This is not a dynamic allocation API.
Sourcepub fn register_with_key(
id: u8,
_crate_name: &str,
_label: &str,
stable_key: &str,
) -> Result<VirtualMemory<DefaultMemoryImpl>, MemoryRegistryError>
pub fn register_with_key( id: u8, _crate_name: &str, _label: &str, stable_key: &str, ) -> Result<VirtualMemory<DefaultMemoryImpl>, MemoryRegistryError>
Open one already-validated stable-memory ID using its explicit ABI-stable key.
Sourcepub fn inspect(id: u8) -> Option<MemoryInspection>
pub fn inspect(id: u8) -> Option<MemoryInspection>
Inspect who currently owns one memory id and whether it is registered.
Sourcepub fn registered() -> Vec<RegisteredMemory>
pub fn registered() -> Vec<RegisteredMemory>
List every registered memory slot with owner/range/label context.
Sourcepub fn registered_for_owner(owner: &str) -> Vec<RegisteredMemory>
pub fn registered_for_owner(owner: &str) -> Vec<RegisteredMemory>
List all registered memory slots for one owner.
Sourcepub fn find(owner: &str, label: &str) -> Option<RegisteredMemory>
pub fn find(owner: &str, label: &str) -> Option<RegisteredMemory>
Find one registered memory slot by owner and label.
Sourcepub fn ledger_snapshot() -> Result<LedgerSnapshot, MemoryRegistryError>
pub fn ledger_snapshot() -> Result<LedgerSnapshot, MemoryRegistryError>
Read the persisted ABI ledger without relying on current registry reconstruction.