Struct walrus::ModuleMemories
source · pub struct ModuleMemories { /* private fields */ }
Expand description
The set of memories in this module.
Implementations§
source§impl ModuleMemories
impl ModuleMemories
sourcepub fn add_import(
&mut self,
shared: bool,
initial: u32,
maximum: Option<u32>,
import: ImportId
) -> MemoryId
pub fn add_import( &mut self, shared: bool, initial: u32, maximum: Option<u32>, import: ImportId ) -> MemoryId
Add an imported memory
sourcepub fn add_local(
&mut self,
shared: bool,
initial: u32,
maximum: Option<u32>
) -> MemoryId
pub fn add_local( &mut self, shared: bool, initial: u32, maximum: Option<u32> ) -> MemoryId
Construct a new memory, that does not originate from any of the input wasm memories.
sourcepub fn get_mut(&mut self, id: MemoryId) -> &mut Memory
pub fn get_mut(&mut self, id: MemoryId) -> &mut Memory
Gets a reference to a memory given its id
sourcepub fn delete(&mut self, id: MemoryId)
pub fn delete(&mut self, id: MemoryId)
Removes a memory from this module.
It is up to you to ensure that any potential references to the deleted
memory are also removed, eg mem.load
expressions and exports.
sourcepub fn iter(&self) -> impl Iterator<Item = &Memory>
pub fn iter(&self) -> impl Iterator<Item = &Memory>
Get a shared reference to this module’s memories.
Trait Implementations§
source§impl Debug for ModuleMemories
impl Debug for ModuleMemories
source§impl Default for ModuleMemories
impl Default for ModuleMemories
source§fn default() -> ModuleMemories
fn default() -> ModuleMemories
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ModuleMemories
impl Send for ModuleMemories
impl Sync for ModuleMemories
impl Unpin for ModuleMemories
impl UnwindSafe for ModuleMemories
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more