Struct wasmer_vm::VMFunction
source · [−]pub struct VMFunction {
pub address: *const VMFunctionBody,
pub vmctx: VMFunctionEnvironment,
pub signature: FunctionType,
pub kind: VMFunctionKind,
pub call_trampoline: Option<VMTrampoline>,
pub instance_ref: Option<WeakOrStrongInstanceRef>,
}
Expand description
A function export value.
Fields
address: *const VMFunctionBody
The address of the native-code function.
vmctx: VMFunctionEnvironment
Pointer to the containing VMContext
.
signature: FunctionType
The function type, used for compatibility checking.
kind: VMFunctionKind
The function kind (specifies the calling convention for the function).
call_trampoline: Option<VMTrampoline>
Address of the function call trampoline owned by the same VMContext that owns the VMFunctionBody.
May be None
when the function is a host function (FunctionType
== Dynamic
or vmctx
== nullptr
).
instance_ref: Option<WeakOrStrongInstanceRef>
A “reference” to the instance through the
InstanceRef
. None
if it is a host function.
Implementations
sourceimpl VMFunction
impl VMFunction
sourcepub fn upgrade_instance_ref(&mut self) -> Option<()>
pub fn upgrade_instance_ref(&mut self) -> Option<()>
Converts the stored instance ref into a strong InstanceRef
if it is weak.
Returns None if it cannot be upgraded.
Trait Implementations
sourceimpl Clone for VMFunction
impl Clone for VMFunction
sourcefn clone(&self) -> VMFunction
fn clone(&self) -> VMFunction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for VMFunction
impl Debug for VMFunction
sourceimpl From<VMFunction> for VMExtern
impl From<VMFunction> for VMExtern
sourcefn from(func: VMFunction) -> Self
fn from(func: VMFunction) -> Self
Converts to this type from the input type.
sourceimpl MemoryUsage for VMFunction
impl MemoryUsage for VMFunction
sourcefn 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
sourceimpl PartialEq<VMFunction> for VMFunction
impl PartialEq<VMFunction> for VMFunction
sourcefn eq(&self, other: &VMFunction) -> bool
fn eq(&self, other: &VMFunction) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &VMFunction) -> bool
fn ne(&self, other: &VMFunction) -> bool
This method tests for !=
.
impl Send for VMFunction
Safety
There is no non-threadsafe logic directly in this type. Calling the function may not be threadsafe.
impl StructuralPartialEq for VMFunction
impl Sync for VMFunction
Safety
The members of an VMFunction are immutable after construction.
Auto Trait Implementations
Blanket Implementations
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
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.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
sourceimpl<T> Upcastable for T where
T: 'static + Any + Send + Sync,
impl<T> Upcastable for T where
T: 'static + Any + Send + Sync,
sourcefn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
sourcefn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref