pub struct ExportFunctionMetadata { /* private fields */ }
Expand description
Extra metadata about ExportFunction
s.
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
impl ExportFunctionMetadata
Sourcepub 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
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 beSend
. - all function pointers must work on any thread.
Trait Implementations§
Source§impl Debug for ExportFunctionMetadata
impl Debug for ExportFunctionMetadata
Source§impl Drop for ExportFunctionMetadata
impl Drop for ExportFunctionMetadata
Source§impl MemoryUsage for ExportFunctionMetadata
impl MemoryUsage for ExportFunctionMetadata
Source§fn size_of_val(&self, visited: &mut dyn MemoryUsageTracker) -> usize
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
impl PartialEq for ExportFunctionMetadata
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.
impl StructuralPartialEq for ExportFunctionMetadata
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§
impl Freeze for ExportFunctionMetadata
impl RefUnwindSafe for ExportFunctionMetadata
impl Unpin for ExportFunctionMetadata
impl UnwindSafe for ExportFunctionMetadata
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
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
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Upcastable for T
impl<T> Upcastable for T
Source§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
Source§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref