[][src]Trait wasmer_vm::Table

pub trait Table: Debug + Send + Sync {
    pub fn style(&self) -> &TableStyle;
pub fn ty(&self) -> &TableType;
pub fn size(&self) -> u32;
pub fn grow(&self, delta: u32) -> Option<u32>;
pub fn get(&self, index: u32) -> Option<VMCallerCheckedAnyfunc>;
pub fn set(
        &self,
        index: u32,
        func: VMCallerCheckedAnyfunc
    ) -> Result<(), Trap>;
pub fn vmtable(&self) -> NonNull<VMTableDefinition>; pub fn copy(
        &self,
        src_table: &dyn Table,
        dst_index: u32,
        src_index: u32,
        len: u32
    ) -> Result<(), Trap> { ... } }

Trait for implementing the interface of a Wasm table.

Required methods

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

Returns the style for this Table.

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

Returns the type for this Table.

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

Returns the number of allocated elements.

pub fn grow(&self, delta: u32) -> 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.

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

Get reference to the specified element.

Returns None if the index is out of bounds.

pub fn set(&self, index: u32, func: VMCallerCheckedAnyfunc) -> Result<(), Trap>[src]

Set reference to the specified element.

Errors

Returns an error if the index is out of bounds.

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

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

Loading content...

Provided methods

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

Errors

Returns an error if the range is out of bounds of either the source or destination tables.

Loading content...

Implementors

impl Table for LinearTable[src]

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

Returns the type for this Table.

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

Returns the style for this Table.

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

Returns the number of allocated elements.

pub fn grow(&self, delta: u32) -> 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.

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

Get reference to the specified element.

Returns None if the index is out of bounds.

pub fn set(&self, index: u32, func: VMCallerCheckedAnyfunc) -> Result<(), Trap>[src]

Set reference to the specified element.

Errors

Returns an error if the index is out of bounds.

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

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

Loading content...