logo
pub struct Exports { /* private fields */ }
Expand description

Exports is a special kind of map that allows easily unwrapping the types of instances.

TODO: add examples of using exports

Implementations

Creates a new Exports.

Creates a new Exports with capacity n.

Return the number of exports in the Exports map.

Return whether or not there are no exports

Insert a new export into this Exports map.

Get an export given a name.

The get method is specifically made for usage inside of Rust APIs, as we can detect what’s the desired type easily.

If you want to get an export dynamically with type checking please use the following functions: get_func, get_memory, get_table or get_global instead.

If you want to get an export dynamically handling manually type checking manually, please use get_extern.

Get an export as a Global.

Get an export as a Memory.

Get an export as a Table.

Get an export as a Func.

👎 Deprecated since 3.0.0:

get_native_function() has been renamed to get_typed_function(), just like NativeFunc has been renamed to TypedFunction.

Get an export as a TypedFunction.

Get an export as a TypedFunction.

Hack to get this working with nativefunc too

Like get_with_generics but with a WeakReference to the InstanceRef internally. This is useful for passing data into Context data, for example.

Get an export as an Extern.

Returns true if the Exports contains the given export name.

Get an iterator over the exports.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Creates a value from an iterator. Read more

Which kind of iterator are we turning this into?

The type of the elements being iterated over.

Creates an iterator from a value. Read more

Which kind of iterator are we turning this into?

The type of the elements being iterated over.

Creates an iterator from a value. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

The archived version of the pointer metadata for this type.

Converts some archived metadata to the pointer metadata for itself.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Deserializes using the given deserializer

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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

The type for metadata in pointers and references to Self.

The resulting type after obtaining ownership.

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

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.

upcast ref

upcast mut ref

upcast boxed dyn

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more