Struct wasmer_engine::ExportFunctionMetadata[][src]

pub struct ExportFunctionMetadata { /* fields omitted */ }
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

impl ExportFunctionMetadata[src]

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
[src]

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

impl Debug for ExportFunctionMetadata[src]

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

Formats the value using the given formatter. Read more

impl Drop for ExportFunctionMetadata[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

impl MemoryUsage for ExportFunctionMetadata[src]

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

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

impl PartialEq<ExportFunctionMetadata> for ExportFunctionMetadata[src]

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

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &ExportFunctionMetadata) -> bool[src]

This method tests for !=.

impl Send for ExportFunctionMetadata[src]

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

impl StructuralPartialEq for ExportFunctionMetadata[src]

impl Sync for ExportFunctionMetadata[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> ArchivePointee for T

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.

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

Converts some archived metadata to the pointer metadata for itself.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointee for T

type Metadata = ()

The type for metadata in pointers and references to Self.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.