[−][src]Struct wasmer_runtime_core::import::ImportObject
All of the import data used when instantiating.
It's suggested that you use the imports! macro
instead of creating an ImportObject by hand.
Usage:
let import_object = imports! { "env" => { "foo" => func!(foo), }, }; fn foo(_: &mut Ctx, n: i32) -> i32 { n }
Fields
allow_missing_functions: boolMethods
impl ImportObject[src]
pub fn new() -> Self[src]
Create a new ImportObject.
pub fn new_with_data<F>(state_creator: F) -> Self where
F: Fn() -> (*mut c_void, fn(_: *mut c_void)) + 'static, [src]
F: Fn() -> (*mut c_void, fn(_: *mut c_void)) + 'static,
pub fn register<S, N>(
&mut self,
name: S,
namespace: N
) -> Option<Box<dyn LikeNamespace>> where
S: Into<String>,
N: LikeNamespace + 'static, [src]
&mut self,
name: S,
namespace: N
) -> Option<Box<dyn LikeNamespace>> where
S: Into<String>,
N: LikeNamespace + 'static,
Register anything that implements LikeNamespace as a namespace.
Usage:
fn register(instance: Instance, namespace: Namespace) { let mut import_object = ImportObject::new(); import_object.register("namespace0", instance); import_object.register("namespace1", namespace); // ... }
pub fn get_namespace(
&self,
namespace: &str
) -> Option<Ref<dyn LikeNamespace + 'static>>[src]
&self,
namespace: &str
) -> Option<Ref<dyn LikeNamespace + 'static>>
pub fn clone_ref(&self) -> Self[src]
Trait Implementations
impl IntoIterator for ImportObject[src]
type IntoIter = ImportObjectIterator
Which kind of iterator are we turning this into?
type Item = (String, String, Export)
The type of the elements being iterated over.
fn into_iter(self) -> Self::IntoIter[src]
impl Extend<(String, String, Export)> for ImportObject[src]
Auto Trait Implementations
impl !Send for ImportObject
impl Unpin for ImportObject
impl !Sync for ImportObject
impl !UnwindSafe for ImportObject
impl !RefUnwindSafe for ImportObject
Blanket Implementations
impl<I> IntoIterator for I where
I: Iterator, [src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,