Struct wasm_runtime_layer::Imports
source · pub struct Imports { /* private fields */ }
Expand description
All of the import data used when instantiating.
Implementations§
source§impl Imports
impl Imports
sourcepub fn get_export(&self, module: &str, name: &str) -> Option<Extern>
pub fn get_export(&self, module: &str, name: &str) -> Option<Extern>
Gets an export given a module and a name
sourcepub fn exists(&self, module: &str, name: &str) -> bool
pub fn exists(&self, module: &str, name: &str) -> bool
Returns if an export exist for a given module and name.
sourcepub fn contains_namespace(&self, name: &str) -> bool
pub fn contains_namespace(&self, name: &str) -> bool
Returns true if the Imports contains namespace with the provided name.
sourcepub fn register_namespace(
&mut self,
ns: &str,
contents: impl IntoIterator<Item = (String, Extern)>
)
pub fn register_namespace( &mut self, ns: &str, contents: impl IntoIterator<Item = (String, Extern)> )
Register a list of externs into a namespace.
sourcepub fn define(&mut self, ns: &str, name: &str, val: impl Into<Extern>)
pub fn define(&mut self, ns: &str, name: &str, val: impl Into<Extern>)
Add a single import with a namespace ns
and name name
.
sourcepub fn iter(&self) -> ImportsIterator<'_> ⓘ
pub fn iter(&self) -> ImportsIterator<'_> ⓘ
Iterates through all the imports in this structure
Trait Implementations§
source§impl Extend<((String, String), Extern)> for Imports
impl Extend<((String, String), Extern)> for Imports
source§fn extend<T: IntoIterator<Item = ((String, String), Extern)>>(
&mut self,
iter: T
)
fn extend<T: IntoIterator<Item = ((String, String), Extern)>>( &mut self, iter: T )
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl IntoIterator for &Imports
impl IntoIterator for &Imports
Auto Trait Implementations§
impl Freeze for Imports
impl !RefUnwindSafe for Imports
impl Send for Imports
impl Sync for Imports
impl Unpin for Imports
impl !UnwindSafe 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