Struct wasmer_vm::LinearMemory[][src]

pub struct LinearMemory { /* fields omitted */ }
Expand description

A linear memory instance.

Implementations

impl LinearMemory[src]

pub fn new(
    memory: &MemoryType,
    style: &MemoryStyle
) -> Result<Self, MemoryError>
[src]

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

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

pub unsafe fn from_definition(
    memory: &MemoryType,
    style: &MemoryStyle,
    vm_memory_location: NonNull<VMMemoryDefinition>
) -> Result<Self, MemoryError>
[src]

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

This creates a LinearMemory 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.

Trait Implementations

impl Debug for LinearMemory[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Memory for LinearMemory[src]

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

Returns the type for this memory.

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

Returns the memory style for this memory.

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

Returns the number of allocated wasm pages.

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]

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

impl MemoryUsage for LinearMemory[src]

fn size_of_val(&self, visited: &mut dyn MemoryUsageTracker) -> usize[src]

Returns the size of the referenced value in bytes. Read more

impl Send for LinearMemory[src]

We must implement this because of VMMemoryDefinitionOwnership::VMOwned. This is correct because synchronization of memory accesses is controlled by the VM.

impl Sync for LinearMemory[src]

This is correct because all internal mutability is protected by a mutex.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> ArchivePointee for T

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.

pub fn pointer_metadata(
    &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointee for T

type Metadata = ()

The type for metadata in pointers and references to Self.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.