Get a memory export by name.
(&self, name: &str)
| 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 | /// |
nothing calls this directly
no test coverage detected