MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / get_memory

Method get_memory

crates/wasmtime/src/runtime/instance.rs:552–554  ·  view source on GitHub ↗

Looks up an exported [`Memory`] value by name. Returns `None` if there was no export named `name`, or if there was but it wasn't a memory. # Panics Panics if `store` does not own this instance.

(&self, store: impl AsContextMut, name: &str)

Source from the content-addressed store, hash-verified

550 ///
551 /// Panics if `store` does not own this instance.
552 pub fn get_memory(&self, store: impl AsContextMut, name: &str) -> Option<Memory> {
553 self.get_export(store, name)?.into_memory()
554 }
555
556 /// Looks up an exported [`SharedMemory`] value by name.
557 ///

Calls 2

into_memoryMethod · 0.80
get_exportMethod · 0.45

Tested by 15

test_multi_memoryFunction · 0.36
test_limitsFunction · 0.36
test_limits_asyncFunction · 0.36
test_limits_memory_onlyFunction · 0.36
test_limits_table_onlyFunction · 0.36
memory_zeroedFunction · 0.36
test_async_host_funcFunction · 0.36