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 VMFunctionBody
The address of the native-code function.
vmctx: VMFunctionEnvironment
Pointer to the containing VMContext
.
signature: VMSharedSignatureIndex
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§
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
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.