pub struct Table(/* private fields */);Expand description
Newtype wrapper around wasmi::Table.
Implementations§
Source§impl Table
 
impl Table
Sourcepub fn new(inner: Table) -> Self
 
pub fn new(inner: Table) -> Self
Create a wasm_runtime_layer::Table-compatible Table from a wasmi::Table.
Sourcepub fn into_inner(self) -> Table
 
pub fn into_inner(self) -> Table
Consume a Table to obtain the inner wasmi::Table.
Methods from Deref<Target = Table>§
Sourcepub fn grow(
    &self,
    ctx: impl AsContextMut,
    delta: u64,
    init: Val,
) -> Result<u64, TableError>
 
pub fn grow( &self, ctx: impl AsContextMut, delta: u64, init: Val, ) -> Result<u64, TableError>
Grows the table by the given amount of elements.
Returns the old size of the Table upon success.
§Note
The newly added elements are initialized to the init Val.
§Errors
- If the table is grown beyond its maximum limits.
- If valuedoes not match theTableelement type.
§Panics
Panics if ctx does not own this Table.
Sourcepub fn set(
    &self,
    ctx: impl AsContextMut,
    index: u64,
    value: Val,
) -> Result<(), TableError>
 
pub fn set( &self, ctx: impl AsContextMut, index: u64, value: Val, ) -> Result<(), TableError>
Sourcepub fn fill(
    &self,
    ctx: impl AsContextMut,
    dst: u64,
    val: Val,
    len: u64,
) -> Result<(), TableError>
 
pub fn fill( &self, ctx: impl AsContextMut, dst: u64, val: Val, len: u64, ) -> Result<(), TableError>
Trait Implementations§
Source§impl WasmTable<Engine> for Table
 
impl WasmTable<Engine> for Table
Source§fn new(
    ctx: impl AsContextMut<Engine>,
    ty: TableType,
    init: Value<Engine>,
) -> Result<Self>
 
fn new( ctx: impl AsContextMut<Engine>, ty: TableType, init: Value<Engine>, ) -> Result<Self>
Creates a new table to the store.
Source§fn ty(&self, ctx: impl AsContext<Engine>) -> TableType
 
fn ty(&self, ctx: impl AsContext<Engine>) -> TableType
Returns the type and limits of the table.
Source§fn grow(
    &self,
    ctx: impl AsContextMut<Engine>,
    delta: u32,
    init: Value<Engine>,
) -> Result<u32>
 
fn grow( &self, ctx: impl AsContextMut<Engine>, delta: u32, init: Value<Engine>, ) -> Result<u32>
Grows the table by the given amount of elements.
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more