pub struct InstancePre<T> { /* private fields */ }
Expand description

An instance, pre-instantiation, that is ready to be instantiated.

This structure represents an instance just before it was instantiated, after all type-checking and imports have been resolved. The only thing left to do for this instance is to actually run the process of instantiation.

Note that an InstancePre may not be tied to any particular Store if none of the imports it closed over are tied to any particular Store.

This structure is created through the Linker::instantiate_pre method, which also has some more information and examples.

Implementations

Returns a reference to the module that this InstancePre will be instantiating.

Instantiates this instance, creating a new instance within the provided store.

This function will run the actual process of instantiation to completion. This will use all of the previously-closed-over items as imports to instantiate the module that this was originally created with.

For more information about instantiation see Instance::new.

Panics

Panics if any import closed over by this InstancePre isn’t owned by store, or if store has async support enabled. Additionally this function will panic if the store provided comes from a different Engine than the InstancePre originally came from.

Creates a new instance, running the start function asynchronously instead of inline.

For more information about asynchronous instantiation see the documentation on Instance::new_async.

Panics

Panics if any import closed over by this InstancePre isn’t owned by store, or if store does not have async support enabled.

Trait Implementations

InstancePre’s clone does not require T: Clone

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.