[−][src]Struct wasmer::Table
A WebAssembly table
instance.
The Table
struct is an array-like structure representing a WebAssembly Table,
which stores function references.
A table created by the host or in WebAssembly code will be accessible and mutable from both host and WebAssembly.
Spec: https://webassembly.github.io/spec/core/exec/runtime.html#table-instances
Implementations
impl Table
[src]
pub fn new(
store: &Store,
ty: TableType,
init: Val
) -> Result<Self, RuntimeError>
[src]
store: &Store,
ty: TableType,
init: Val
) -> Result<Self, RuntimeError>
Creates a new Table
with the provided TableType
definition.
All the elements in the table will be set to the init
value.
This function will construct the Table
using the store Tunables
.
pub fn ty(&self) -> &TableType
[src]
Returns the TableType
of the Table
.
pub fn store(&self) -> &Store
[src]
Returns the Store
where the Table
belongs.
pub fn get(&self, index: u32) -> Option<Val>
[src]
Retrieves an element of the table at the provided index
.
pub fn set(&self, index: u32, val: Val) -> Result<(), RuntimeError>
[src]
Sets an element val
in the Table at the provided index
.
pub fn size(&self) -> u32
[src]
Retrieves the size of the Table
(in elements)
pub fn grow(&self, delta: u32, init: Val) -> Result<u32, RuntimeError>
[src]
Grows the size of the Table
by delta
, initializating
the elements with the provided init
value.
It returns the previous size of the Table
in case is able
to grow the Table successfully.
Errors
Returns an error if the delta
is out of bounds for the table.
pub fn copy(
dst_table: &Self,
dst_index: u32,
src_table: &Self,
src_index: u32,
len: u32
) -> Result<(), RuntimeError>
[src]
dst_table: &Self,
dst_index: u32,
src_table: &Self,
src_index: u32,
len: u32
) -> Result<(), RuntimeError>
Copies the len
elements of src_table
starting at src_index
to the destination table dst_table
at index dst_index
.
Errors
Returns an error if the range is out of bounds of either the source or destination tables.
pub fn same(&self, other: &Self) -> bool
[src]
Returns whether or not these two tables refer to the same data.
Trait Implementations
impl Clone for Table
[src]
impl<'a> Exportable<'a> for Table
[src]
pub fn to_export(&self) -> Export
[src]
pub fn get_self_from_extern(
_extern: &'a Extern
) -> Result<&'a Self, ExportError>
[src]
_extern: &'a Extern
) -> Result<&'a Self, ExportError>
impl From<Table> for Extern
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Table
[src]
impl Send for Table
[src]
impl Sync for Table
[src]
impl Unpin for Table
[src]
impl !UnwindSafe for Table
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,