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
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§
impl Freeze for VMFunction
impl !RefUnwindSafe for VMFunction
impl Unpin for VMFunction
impl !UnwindSafe for VMFunction
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.