Struct wasmer_vm::VMMemory

source ·
pub struct VMMemory(pub Box<dyn LinearMemory + 'static>);
Expand description

Represents linear memory that can be either owned or shared

Tuple Fields§

§0: Box<dyn LinearMemory + 'static>

Implementations§

Creates a new linear memory instance of the correct type with specified minimum and maximum number of wasm pages.

This creates a Memory with owned metadata: this can be used to create a memory that will be imported into Wasm modules.

Returns the number of pages in the allocated memory block

Create a new linear memory instance with specified minimum and maximum number of wasm pages.

This creates a Memory with metadata owned by a VM, pointed to by vm_memory_location: this can be used to create a local memory.

Safety
  • vm_memory_location must point to a valid location in VM memory.

Creates VMMemory from a custom implementation - the following into implementations are natively supported

  • VMOwnedMemory -> VMMemory
  • Box<dyn LinearMemory + ’static> -> VMMemory

Trait Implementations§

Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.

Returns the type for this memory.

Returns the size of hte memory in pages

Grow memory by the specified amount of wasm pages.

Returns None if memory can’t be grown by the specified amount of wasm pages.

Returns the memory style for this memory.

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

Attempts to clone this memory (if its clonable)

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
The archived version of the pointer metadata for this type.
Converts some archived metadata to the pointer metadata for itself.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Deserializes using the given deserializer

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type for metadata in pointers and references to Self.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.