Trait wasmer_vm::Memory [−][src]
pub trait Memory: Debug + Send + Sync + MemoryUsage { fn ty(&self) -> MemoryType; fn style(&self) -> &MemoryStyle; fn size(&self) -> Pages; fn grow(&self, delta: Pages) -> Result<Pages, MemoryError>; fn vmmemory(&self) -> NonNull<VMMemoryDefinition>; }
Expand description
Trait for implementing Wasm Memory used by Wasmer.
Required methods
fn ty(&self) -> MemoryType
[src]
fn ty(&self) -> MemoryType
[src]Returns the memory type for this memory.
fn style(&self) -> &MemoryStyle
[src]
fn style(&self) -> &MemoryStyle
[src]Returns the memory style for this memory.
fn grow(&self, delta: Pages) -> Result<Pages, MemoryError>
[src]
fn grow(&self, delta: Pages) -> Result<Pages, MemoryError>
[src]Grow memory by the specified amount of wasm pages.
fn vmmemory(&self) -> NonNull<VMMemoryDefinition>
[src]
fn vmmemory(&self) -> NonNull<VMMemoryDefinition>
[src]Return a VMMemoryDefinition
for exposing the memory to compiled wasm code.
The pointer returned in VMMemoryDefinition
must be valid for the lifetime of this memory.
Implementors
impl Memory for LinearMemory
[src]
impl Memory for LinearMemory
[src]fn ty(&self) -> MemoryType
[src]
fn ty(&self) -> MemoryType
[src]Returns the type for this memory.
fn style(&self) -> &MemoryStyle
[src]
fn style(&self) -> &MemoryStyle
[src]Returns the memory style for this memory.
fn grow(&self, delta: Pages) -> Result<Pages, MemoryError>
[src]
fn grow(&self, delta: Pages) -> Result<Pages, MemoryError>
[src]Grow memory by the specified amount of wasm pages.
Returns None
if memory can’t be grown by the specified amount
of wasm pages.
fn vmmemory(&self) -> NonNull<VMMemoryDefinition>
[src]
fn vmmemory(&self) -> NonNull<VMMemoryDefinition>
[src]Return a VMMemoryDefinition
for exposing the memory to compiled wasm code.