pub struct Imports { /* private fields */ }Expand description
Entities provided by the host to satisfy a module’s state imports
(memories, globals, tables), resolved eagerly at instantiation.
Function imports resolve separately and lazily via
Store::register_host_func.
Implementations§
Source§impl Imports
impl Imports
Sourcepub fn memory(self, module: &str, name: &str, ty: MemType) -> Self
pub fn memory(self, module: &str, name: &str, ty: MemType) -> Self
Provide an imported memory (module, name) (fresh allocation).
Provide an imported memory (module, name) linked from another
module’s exports (shared handle).
Sourcepub fn global(
self,
module: &str,
name: &str,
ty: GlobalType,
value: Value,
) -> Self
pub fn global( self, module: &str, name: &str, ty: GlobalType, value: Value, ) -> Self
Provide an imported global (module, name) with its value.
Provide an imported global (module, name) linked from another
module’s exports (shared cell).
Sourcepub fn table(self, module: &str, name: &str, ty: TableType) -> Self
pub fn table(self, module: &str, name: &str, ty: TableType) -> Self
Provide an imported table (module, name) (fresh allocation).
Provide an imported table (module, name) linked from another
module’s exports (shared handle).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Imports
impl !Send for Imports
impl !Sync for Imports
impl !UnwindSafe for Imports
impl Freeze for Imports
impl Unpin for Imports
impl UnsafeUnpin for Imports
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