mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-06 20:58:28 +00:00
Added spec docs to app API public objects
This commit is contained in:
5
lib/api/src/externals/table.rs
vendored
5
lib/api/src/externals/table.rs
vendored
@@ -12,6 +12,8 @@ use wasmer_vm::{Export, ExportTable, Table as RuntimeTable, VMCallerCheckedAnyfu
|
||||
///
|
||||
/// A table created by the host or in WebAssembly code will be accessible and
|
||||
/// mutable from both host and WebAssembly.
|
||||
///
|
||||
/// Spec: https://webassembly.github.io/spec/core/exec/runtime.html#table-instances
|
||||
#[derive(Clone)]
|
||||
pub struct Table {
|
||||
store: Store,
|
||||
@@ -30,6 +32,8 @@ impl Table {
|
||||
/// 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 [`Tunables`].
|
||||
pub fn new(store: &Store, ty: TableType, init: Val) -> Result<Table, RuntimeError> {
|
||||
let item = init.into_checked_anyfunc(store)?;
|
||||
let tunables = store.tunables();
|
||||
@@ -54,6 +58,7 @@ impl Table {
|
||||
self.table.ty()
|
||||
}
|
||||
|
||||
/// Returns the [`Store`] that owns this `Table`.
|
||||
pub fn store(&self) -> &Store {
|
||||
&self.store
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user