Struct unc_vm_vm::VMFunction
source · pub struct VMFunction {
pub address: *const VMFunctionBody,
pub vmctx: VMFunctionEnvironment,
pub signature: VMSharedSignatureIndex,
pub kind: VMFunctionKind,
pub call_trampoline: Option<VMTrampoline>,
pub instance_ref: Option<WeakOrStrongInstanceRef>,
}Expand description
A function export value.
Fields§
§address: *const VMFunctionBodyThe address of the native-code function.
vmctx: VMFunctionEnvironmentPointer to the containing VMContext.
signature: VMSharedSignatureIndexThe function type, used for compatibility checking.
kind: VMFunctionKindThe 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§
source§impl 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§
source§impl Clone for VMFunction
impl Clone for VMFunction
source§fn clone(&self) -> VMFunction
fn clone(&self) -> VMFunction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for VMFunction
impl Debug for VMFunction
source§impl From<VMFunction> for VMExtern
impl From<VMFunction> for VMExtern
source§fn from(func: VMFunction) -> Self
fn from(func: VMFunction) -> Self
source§impl PartialEq for VMFunction
impl PartialEq for VMFunction
source§fn eq(&self, other: &VMFunction) -> bool
fn eq(&self, other: &VMFunction) -> bool
self and other values to be equal, and is used
by ==.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.