This repository was archived by the owner on Oct 3, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -72,11 +72,11 @@ impl FuncContext<'_> {
7272 }
7373
7474 /// Get a reference to an exported memory
75- pub fn exported_memory ( & mut self , name : & str ) -> Result < MemoryRef < ' _ > > {
75+ pub fn exported_memory ( & self , name : & str ) -> Result < MemoryRef < ' _ > > {
7676 self . module ( ) . exported_memory ( self . store , name)
7777 }
7878
79- /// Get a reference to an exported memory
79+ /// Get a mutable reference to an exported memory
8080 pub fn exported_memory_mut ( & mut self , name : & str ) -> Result < MemoryRefMut < ' _ > > {
8181 self . module ( ) . exported_memory_mut ( self . store , name)
8282 }
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ impl ModuleInstance {
189189 }
190190
191191 /// Get an exported memory by name
192- pub fn exported_memory < ' a > ( & self , store : & ' a mut Store , name : & str ) -> Result < MemoryRef < ' a > > {
192+ pub fn exported_memory < ' a > ( & self , store : & ' a Store , name : & str ) -> Result < MemoryRef < ' a > > {
193193 let export = self . export_addr ( name) . ok_or_else ( || Error :: Other ( format ! ( "Export not found: {name}" ) ) ) ?;
194194 let ExternVal :: Memory ( mem_addr) = export else {
195195 return Err ( Error :: Other ( format ! ( "Export is not a memory: {name}" ) ) ) ;
@@ -198,7 +198,7 @@ impl ModuleInstance {
198198 self . memory ( store, mem_addr)
199199 }
200200
201- /// Get an exported memory by name
201+ /// Get an exported memory by name (mutable)
202202 pub fn exported_memory_mut < ' a > ( & self , store : & ' a mut Store , name : & str ) -> Result < MemoryRefMut < ' a > > {
203203 let export = self . export_addr ( name) . ok_or_else ( || Error :: Other ( format ! ( "Export not found: {name}" ) ) ) ?;
204204 let ExternVal :: Memory ( mem_addr) = export else {
You can’t perform that action at this time.
0 commit comments