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

Method get_shared_memory

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

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

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

Source from the content-addressed store, hash-verified

562 ///
563 /// Panics if `store` does not own this instance.
564 pub fn get_shared_memory(
565 &self,
566 mut store: impl AsContextMut,
567 name: &str,
568 ) -> Option<SharedMemory> {
569 let mut store = store.as_context_mut();
570 self.get_export(&mut store, name)?.into_shared_memory()
571 }
572
573 /// Looks up an exported [`Global`] value by name.
574 ///

Callers 4

test_multi_memoryFunction · 0.80
get_memoryMethod · 0.80

Calls 3

into_shared_memoryMethod · 0.80
as_context_mutMethod · 0.45
get_exportMethod · 0.45

Tested by 3

test_multi_memoryFunction · 0.64