MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / memory

Method memory

crates/tinywasm/src/instance.rs:524–532  ·  view source on GitHub ↗

Get a memory export by name.

(&self, name: &str)

Source from the content-addressed store, hash-verified

522
523 /// Get a memory export by name.
524 pub fn memory(&self, name: &str) -> Result<Memory> {
525 match self.require_export(name)? {
526 ExternVal::Memory(mem_addr) => Ok(Memory::from_store_addr(self.0.store_id, mem_addr)),
527 _ => {
528 cold_path();
529 Err(Error::Other(format!("Export is not a memory: {name}")))
530 }
531 }
532 }
533
534 /// Get a memory by its module-local index.
535 ///

Callers

nothing calls this directly

Calls 1

require_exportMethod · 0.80

Tested by

no test coverage detected