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,
memory64: bool,
initial: u64,
maximum: Option<u64>,
page_size_log2: Option<u32>,
import: ImportId,
) -> MemoryId
pub fn add_import( &mut self, shared: bool, memory64: bool, initial: u64, maximum: Option<u64>, page_size_log2: Option<u32>, import: ImportId, ) -> MemoryId
Add an imported memory
Sourcepub fn add_local(
&mut self,
shared: bool,
memory64: bool,
initial: u64,
maximum: Option<u64>,
page_size_log2: Option<u32>,
) -> MemoryId
pub fn add_local( &mut self, shared: bool, memory64: bool, initial: u64, maximum: Option<u64>, page_size_log2: 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 Freeze for ModuleMemories
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