[][src]Trait wasmer_vm::Memory

pub trait Memory: Debug + Send + Sync {
    pub fn ty(&self) -> &MemoryType;
pub fn style(&self) -> &MemoryStyle;
pub fn size(&self) -> Pages;
pub fn grow(&self, delta: Pages) -> Result<Pages, MemoryError>;
pub fn vmmemory(&self) -> NonNull<VMMemoryDefinition>; }

Trait for implementing Wasm Memory used by Wasmer.

Required methods

pub fn ty(&self) -> &MemoryType[src]

Returns the memory type for this memory.

pub fn style(&self) -> &MemoryStyle[src]

Returns the memory style for this memory.

pub fn size(&self) -> Pages[src]

Returns the number of allocated wasm pages.

pub fn grow(&self, delta: Pages) -> Result<Pages, MemoryError>[src]

Grow memory by the specified amount of wasm pages.

pub 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.

Loading content...

Implementors

impl Memory for LinearMemory[src]

pub fn ty(&self) -> &MemoryType[src]

Returns the type for this memory.

pub fn style(&self) -> &MemoryStyle[src]

Returns the memory style for this memory.

pub fn size(&self) -> Pages[src]

Returns the number of allocated wasm pages.

pub 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.

pub fn vmmemory(&self) -> NonNull<VMMemoryDefinition>[src]

Return a VMMemoryDefinition for exposing the memory to compiled wasm code.

Loading content...