pub struct Table { /* private fields */ }
Expand description
Container with a descriptor and a reference to a table storage.
Implementations§
Source§impl Table
impl Table
Sourcepub fn new(desc: TableDescriptor) -> Result<Self, CreationError>
pub fn new(desc: TableDescriptor) -> Result<Self, CreationError>
Create a new Table
from a TableDescriptor
Usage:
let descriptor = TableDescriptor {
element: ElementType::Anyfunc,
minimum: 10,
maximum: None,
};
let table = Table::new(descriptor)?;
Sourcepub fn descriptor(&self) -> TableDescriptor
pub fn descriptor(&self) -> TableDescriptor
Get the TableDescriptor
used to create this Table
.
Sourcepub fn set<T: StorableInTable>(
&self,
index: u32,
element: T,
) -> Result<(), TableAccessError>
pub fn set<T: StorableInTable>( &self, index: u32, element: T, ) -> Result<(), TableAccessError>
Set the element at index.
Sourcepub fn vm_local_table(&mut self) -> *mut LocalTable
pub fn vm_local_table(&mut self) -> *mut LocalTable
Get a mutable pointer to underlying table storage.
Trait Implementations§
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