Skip to main content

MemoryApi

Struct MemoryApi 

Source
pub struct MemoryApi;
Expand description

MemoryApi

Supported facade for memory bootstrap, dynamic slot registration, and registry inspection.

Implementations§

Source§

impl MemoryApi

Source

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.

Source

pub fn bootstrap_pending() -> Result<(), MemoryRegistryError>

Bootstrap eager TLS, eager-init hooks, and flush deferred registry state without reserving a new owner range.

Source

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.

Source

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.

Source

pub fn declare_with_key_metadata( id: u8, crate_name: &str, label: &str, stable_key: &str, schema_version: Option<u32>, schema_fingerprint: Option<&str>, ) -> Result<(), MemoryRegistryError>

Declare one explicit-key stable-memory ID with optional schema metadata.

Schema metadata is informational in 0.38 and does not affect allocation ownership. This queues metadata only. It does not open virtual memory.

Source

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.

Source

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.

Source

pub fn inspect(id: u8) -> Option<MemoryInspection>

Inspect who currently owns one memory id and whether it is registered.

Source

pub fn registered() -> Vec<RegisteredMemory>

List every registered memory slot with owner/range/label context.

Source

pub fn registered_for_owner(owner: &str) -> Vec<RegisteredMemory>

List all registered memory slots for one owner.

Source

pub fn find(owner: &str, label: &str) -> Option<RegisteredMemory>

Find one registered memory slot by owner and label.

Source

pub fn ledger_snapshot() -> Result<LedgerSnapshot, MemoryRegistryError>

Read the persisted ABI ledger without relying on current registry reconstruction.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.