pub struct Memory { /* private fields */ }
Expand description
A WASM memory.
This type wraps a WebAssembly.Memory
from the JavaScript API.
Trait Implementations§
Source§impl WasmMemory<Engine> for Memory
impl WasmMemory<Engine> for Memory
Source§fn new(_ctx: impl AsContextMut<Engine>, ty: MemoryType) -> Result<Self>
fn new(_ctx: impl AsContextMut<Engine>, ty: MemoryType) -> Result<Self>
Creates a new linear memory to the store.
Source§fn ty(&self, _ctx: impl AsContext<Engine>) -> MemoryType
fn ty(&self, _ctx: impl AsContext<Engine>) -> MemoryType
Returns the memory type of the linear memory.
Source§fn grow(&self, _ctx: impl AsContextMut<Engine>, additional: u32) -> Result<u32>
fn grow(&self, _ctx: impl AsContextMut<Engine>, additional: u32) -> Result<u32>
Grows the linear memory by the given amount of new pages.
Source§fn current_pages(&self, _ctx: impl AsContext<Engine>) -> u32
fn current_pages(&self, _ctx: impl AsContext<Engine>) -> u32
Returns the amount of pages in use by the linear memory.
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