Struct wasm_runtime_layer::Memory
source · pub struct Memory { /* private fields */ }
Expand description
A Wasm linear memory reference.
Implementations§
source§impl Memory
impl Memory
sourcepub fn new<C: AsContextMut>(ctx: C, ty: MemoryType) -> Result<Self>
pub fn new<C: AsContextMut>(ctx: C, ty: MemoryType) -> Result<Self>
Creates a new linear memory to the store.
sourcepub fn ty<C: AsContext>(&self, ctx: C) -> MemoryType
pub fn ty<C: AsContext>(&self, ctx: C) -> MemoryType
Returns the memory type of the linear memory.
sourcepub fn grow<C: AsContextMut>(&self, ctx: C, additional: u32) -> Result<u32>
pub fn grow<C: AsContextMut>(&self, ctx: C, additional: u32) -> Result<u32>
Grows the linear memory by the given amount of new pages.
sourcepub fn current_pages<C: AsContext>(&self, ctx: C) -> u32
pub fn current_pages<C: AsContext>(&self, ctx: C) -> u32
Returns the amount of pages in use by the linear memory.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Memory
impl !RefUnwindSafe for Memory
impl Send for Memory
impl Sync for Memory
impl Unpin for Memory
impl !UnwindSafe for Memory
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