pub enum BackendTable {
Sys(Table),
}Variants§
Implementations§
Source§impl BackendTable
impl BackendTable
Sourcepub fn into_sys(self) -> Table
pub fn into_sys(self) -> Table
Consume self into crate::backend::sys::table::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.
Source§impl BackendTable
impl BackendTable
Sourcepub fn unwrap_sys(self) -> Table
pub fn unwrap_sys(self) -> Table
Unwraps this value to the BackendTable::Sys variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_sys_ref(&self) -> &Table
pub fn unwrap_sys_ref(&self) -> &Table
Unwraps this reference to the BackendTable::Sys variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_sys_mut(&mut self) -> &mut Table
pub fn unwrap_sys_mut(&mut self) -> &mut Table
Unwraps this mutable reference to the BackendTable::Sys variant.
Panics if this value is of any other type.
Source§impl BackendTable
impl BackendTable
Sourcepub fn new(
store: &mut impl AsStoreMut,
ty: TableType,
init: Value,
) -> Result<Self, RuntimeError>
pub fn new( store: &mut impl AsStoreMut, ty: TableType, init: Value, ) -> 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 BaseTunables.
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, initializing
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 copy(
store: &mut impl AsStoreMut,
dst_table: &Self,
dst_index: u32,
src_table: &Self,
src_index: u32,
len: u32,
) -> Result<(), RuntimeError>
pub fn copy( store: &mut impl AsStoreMut, 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(crate) fn from_vm_extern( store: &mut impl AsStoreMut, ext: VMExternTable, ) -> Self
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.
pub(crate) fn to_vm_extern(&self) -> VMExtern
Trait Implementations§
Source§impl Clone for BackendTable
impl Clone for BackendTable
Source§fn clone(&self) -> BackendTable
fn clone(&self) -> BackendTable
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BackendTable
impl Debug for BackendTable
Source§impl From<BackendTable> for Table
impl From<BackendTable> for Table
Source§fn from(value: BackendTable) -> Self
fn from(value: BackendTable) -> Self
Source§impl From<Table> for BackendTable
impl From<Table> for BackendTable
Source§impl PartialEq for BackendTable
impl PartialEq for BackendTable
impl Eq for BackendTable
impl StructuralPartialEq for BackendTable
Auto Trait Implementations§
impl Freeze for BackendTable
impl RefUnwindSafe for BackendTable
impl Send for BackendTable
impl Sync for BackendTable
impl Unpin for BackendTable
impl UnwindSafe for BackendTable
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more