pub struct RuntimeMemory<M: Memory> { /* private fields */ }Expand description
RuntimeMemory
Cloneable virtual memory opened through a runtime’s committed authority.
Implements Memory for stable structures without exposing the backing
memory or an alternate manager. Cloning does not require M: Clone.
Reads delegate to the upstream memory implementation, including its
optimized support for uninitialized destinations through Memory::read_unsafe.
Growth reserves physical capacity before assigning manager buckets. Ordinary
backing refusal, arithmetic overflow and bucket exhaustion return typed errors
without changing virtual extents or manager metadata. Backing implementations
must obey the Memory contract; traps and partial writes are not transactions
on native memory. Typed collections retain their own failure behavior.
Implementations§
Source§impl<M: Memory> RuntimeMemory<M>
impl<M: Memory> RuntimeMemory<M>
Sourcepub fn grow(&self, pages: u64) -> Result<u64, RuntimeGrowError>
pub fn grow(&self, pages: u64) -> Result<u64, RuntimeGrowError>
Grow by the requested pages, returning the previous virtual page count.
Capacity is reserved before assigning manager buckets. Ordinary refusal
preserves virtual extents and manager metadata and permits retry. The
upstream Memory::grow adapter translates errors into its required
-1 sentinel; direct runtime callers receive super::RuntimeGrowError.