pub struct Table(/* private fields */);Expand description
Newtype wrapper around wasmer::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 wasmer::Table.
Sourcepub fn into_inner(self) -> Table
pub fn into_inner(self) -> Table
Consume a Table to obtain the inner wasmer::Table.
Methods from Deref<Target = Table>§
Sourcepub fn as_sys(&self) -> &Table
pub fn as_sys(&self) -> &Table
Convert a reference to self into a reference crate::backend::sys::table::Table.
Sourcepub fn as_sys_mut(&mut self) -> &mut Table
pub fn as_sys_mut(&mut self) -> &mut Table
Convert a mutable reference to self into a mutable reference crate::backend::sys::table::Table.
Sourcepub fn ty(&self, store: &impl AsStoreRef) -> TableType
pub fn ty(&self, store: &impl AsStoreRef) -> TableType
Returns the TableType of the table.
Sourcepub fn get(&self, store: &mut impl AsStoreMut, index: u32) -> Option<Value>
pub fn get(&self, store: &mut impl AsStoreMut, index: u32) -> Option<Value>
Retrieves an element of the table at the provided index.
Sourcepub fn set(
&self,
store: &mut impl AsStoreMut,
index: u32,
val: Value,
) -> Result<(), RuntimeError>
pub fn set( &self, store: &mut impl AsStoreMut, index: u32, val: Value, ) -> Result<(), RuntimeError>
Sets an element val in the Table at the provided index.
Sourcepub fn size(&self, store: &impl AsStoreRef) -> u32
pub fn size(&self, store: &impl AsStoreRef) -> u32
Retrieves the size of the Table (in elements)
Sourcepub fn grow(
&self,
store: &mut impl AsStoreMut,
delta: u32,
init: Value,
) -> Result<u32, RuntimeError>
pub fn grow( &self, store: &mut impl AsStoreMut, delta: u32, init: Value, ) -> Result<u32, RuntimeError>
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.
Sourcepub fn is_from_store(&self, store: &impl AsStoreRef) -> bool
pub fn is_from_store(&self, store: &impl AsStoreRef) -> bool
Checks whether this Table can be used with the given context.
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>
Source§fn ty(&self, ctx: impl AsContext<Engine>) -> TableType
fn ty(&self, ctx: impl AsContext<Engine>) -> TableType
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>
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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.