Struct wasmer_vm::LinearTable[][src]

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

A table instance.

Implementations

impl LinearTable[src]

pub fn new(table: &TableType, style: &TableStyle) -> Result<Self, String>[src]

Create a new linear table instance with specified minimum and maximum number of elements.

This creates a LinearTable with metadata owned by a VM, pointed to by vm_table_location: this can be used to create a local table.

pub unsafe fn from_definition(
    table: &TableType,
    style: &TableStyle,
    vm_table_location: NonNull<VMTableDefinition>
) -> Result<Self, String>
[src]

Create a new linear table instance with specified minimum and maximum number of elements.

This creates a LinearTable with metadata owned by a VM, pointed to by vm_table_location: this can be used to create a local table.

Safety

  • vm_table_location must point to a valid location in VM memory.

Trait Implementations

impl Debug for LinearTable[src]

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

Formats the value using the given formatter. Read more

impl MemoryUsage for LinearTable[src]

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

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

impl Table for LinearTable[src]

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

Returns the type for this Table.

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

Returns the style for this Table.

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

Returns the number of allocated elements.

fn grow(&self, delta: u32, init_value: TableElement) -> Option<u32>[src]

Grow table by the specified amount of elements.

Returns None if table can’t be grown by the specified amount of elements, otherwise returns the previous size of the table.

fn get(&self, index: u32) -> Option<TableElement>[src]

Get reference to the specified element.

Returns None if the index is out of bounds.

fn set(&self, index: u32, reference: TableElement) -> Result<(), Trap>[src]

Set reference to the specified element.

Errors

Returns an error if the index is out of bounds.

fn vmtable(&self) -> NonNull<VMTableDefinition>[src]

Return a VMTableDefinition for exposing the table to compiled wasm code.

fn copy(
    &self,
    src_table: &dyn Table,
    dst_index: u32,
    src_index: u32,
    len: u32
) -> Result<(), Trap>
[src]

Copy len elements from src_table[src_index..] into dst_table[dst_index..]. Read more

impl Send for LinearTable[src]

This is correct because there is no thread-specific data tied to this type.

impl Sync for LinearTable[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.