pub struct Table(/* private fields */);Expand description
A Wasm table reference.
Implementations§
Source§impl Table
impl 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 copy(
store: impl AsContextMut,
dst_table: &Table,
dst_index: u64,
src_table: &Table,
src_index: u64,
len: u64,
) -> Result<(), TableError>
pub fn copy( store: impl AsContextMut, dst_table: &Table, dst_index: u64, src_table: &Table, src_index: u64, len: u64, ) -> 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§
impl Copy for Table
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