(&self, memory: MemoryIndex)
| 392 | /// index is an imported memory. |
| 393 | #[inline] |
| 394 | pub fn defined_memory_index(&self, memory: MemoryIndex) -> Option<DefinedMemoryIndex> { |
| 395 | if memory.index() < self.num_imported_memories { |
| 396 | None |
| 397 | } else { |
| 398 | Some(DefinedMemoryIndex::new( |
| 399 | memory.index() - self.num_imported_memories, |
| 400 | )) |
| 401 | } |
| 402 | } |
| 403 | |
| 404 | /// Convert a `DefinedMemoryIndex` into an `OwnedMemoryIndex`. Returns None |
| 405 | /// if the index is an imported memory. |
no test coverage detected