wasmer_engine

Struct ExportFunctionMetadata

Source
pub struct ExportFunctionMetadata { /* private fields */ }
Expand description

Extra metadata about ExportFunctions.

The metadata acts as a kind of manual virtual dispatch. We store the user-supplied WasmerEnv as a void pointer and have methods on it that have been adapted to accept a void pointer.

This struct owns the original host_env, thus when it gets dropped it calls the drop function on it.

Implementations§

Source§

impl ExportFunctionMetadata

Source

pub unsafe fn new( host_env: *mut c_void, import_init_function_ptr: Option<ImportInitializerFuncPtr>, host_env_clone_fn: fn(_: *mut c_void) -> *mut c_void, host_env_drop_fn: fn(_: *mut c_void), ) -> Self

Create an ExportFunctionMetadata type with information about the exported function.

§Safety
  • the host_env must be Send.
  • all function pointers must work on any thread.

Trait Implementations§

Source§

impl Debug for ExportFunctionMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for ExportFunctionMetadata

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl MemoryUsage for ExportFunctionMetadata

Source§

fn size_of_val(&self, visited: &mut dyn MemoryUsageTracker) -> usize

Returns the size of the referenced value in bytes. Read more
Source§

impl PartialEq for ExportFunctionMetadata

Source§

fn eq(&self, other: &ExportFunctionMetadata) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Send for ExportFunctionMetadata

This can be Send because host_env comes from WasmerEnv which is Send. Therefore all operations should work on any thread.

Source§

impl StructuralPartialEq for ExportFunctionMetadata

Source§

impl Sync for ExportFunctionMetadata

This data may be shared across threads, drop is an unsafe function pointer, so care must be taken when calling it.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcastable for T
where T: Any + Send + Sync + 'static,

Source§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
Source§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
Source§

fn upcast_any_box(self: Box<T>) -> Box<dyn Any>

upcast boxed dyn