pub enum FuncKey {
DefinedWasmFunction(StaticModuleIndex, DefinedFuncIndex),
ArrayToWasmTrampoline(StaticModuleIndex, DefinedFuncIndex),
WasmToArrayTrampoline(ModuleInternedTypeIndex),
WasmToBuiltinTrampoline(BuiltinFunctionIndex),
PulleyHostCall(HostCall),
ComponentTrampoline(Abi, TrampolineIndex),
ResourceDropTrampoline,
UnsafeIntrinsic(Abi, UnsafeIntrinsic),
}Expand description
A sortable, comparable function key for compilation output, call graph edges, and relocations.
Variants§
DefinedWasmFunction(StaticModuleIndex, DefinedFuncIndex)
A Wasm-defined function.
ArrayToWasmTrampoline(StaticModuleIndex, DefinedFuncIndex)
A trampoline from an array-caller to the given Wasm-callee.
WasmToArrayTrampoline(ModuleInternedTypeIndex)
A trampoline from a Wasm-caller to an array-callee of the given type.
WasmToBuiltinTrampoline(BuiltinFunctionIndex)
A trampoline from a Wasm-caller to the given builtin.
PulleyHostCall(HostCall)
A Pulley-specific host call.
ComponentTrampoline(Abi, TrampolineIndex)
A Wasm-caller to component builtin trampoline.
ResourceDropTrampoline
A Wasm-caller to array-callee resource.drop trampoline.
UnsafeIntrinsic(Abi, UnsafeIntrinsic)
A Wasmtime intrinsic function.
Implementations§
Source§impl FuncKey
impl FuncKey
Sourcepub fn into_parts(self) -> (FuncKeyNamespace, FuncKeyIndex)
pub fn into_parts(self) -> (FuncKeyNamespace, FuncKeyIndex)
Split this key into its namespace and index halves.
Sourcepub fn kind(self) -> FuncKeyKind
pub fn kind(self) -> FuncKeyKind
Get this key’s kind.
Sourcepub fn namespace(self) -> FuncKeyNamespace
pub fn namespace(self) -> FuncKeyNamespace
Get this key’s namespace.
Sourcepub fn index(self) -> FuncKeyIndex
pub fn index(self) -> FuncKeyIndex
Get this key’s index.
Sourcepub fn into_raw_parts(self) -> (u32, u32)
pub fn into_raw_parts(self) -> (u32, u32)
Get the raw, underlying (namespace, index) representation of this
compilation key.
The resulting values should only be used for (eventually) calling
FuncKey::from_raw_parts or FuncKey{Namespace,Index}::from_raw.
Sourcepub fn from_parts(namespace: FuncKeyNamespace, index: FuncKeyIndex) -> Self
pub fn from_parts(namespace: FuncKeyNamespace, index: FuncKeyIndex) -> Self
Create a key from its namespace and index parts.
Should only be called with namespaces and indices that are ultimately derived from the same key. For example, if you attempt to pair an index and namespace that come from different keys, that may panic. If it happens not to panic, you’ll end up with a valid key that names an arbitrary function in the given namespace, but that function probably does not actually exist in the compilation artifact.
Sourcepub fn from_raw_parts(a: u32, b: u32) -> Self
pub fn from_raw_parts(a: u32, b: u32) -> Self
Create a key from its raw, underlying representation.
Should only be given the results of a previous call to
FuncKey::into_raw_parts.
Panics when given invalid raw parts.
Sourcepub fn from_raw_u64(value: u64) -> Self
pub fn from_raw_u64(value: u64) -> Self
Create a key from a raw packed u64 representation.
Should only be given a value produced by into_raw_u64().
Panics when given an invalid value.
Sourcepub fn into_raw_u64(&self) -> u64
pub fn into_raw_u64(&self) -> u64
Produce a packed u64 representation of this key.
May be used with from_raw_64() to reconstruct this key.
Sourcepub fn unwrap_defined_wasm_function(
self,
) -> (StaticModuleIndex, DefinedFuncIndex)
pub fn unwrap_defined_wasm_function( self, ) -> (StaticModuleIndex, DefinedFuncIndex)
Unwrap a FuncKey::DefinedWasmFunction or else panic.
Sourcepub fn unwrap_array_to_wasm_trampoline(
self,
) -> (StaticModuleIndex, DefinedFuncIndex)
pub fn unwrap_array_to_wasm_trampoline( self, ) -> (StaticModuleIndex, DefinedFuncIndex)
Unwrap a FuncKey::ArrayToWasmTrampoline or else panic.
Sourcepub fn unwrap_wasm_to_array_trampoline(self) -> ModuleInternedTypeIndex
pub fn unwrap_wasm_to_array_trampoline(self) -> ModuleInternedTypeIndex
Unwrap a FuncKey::WasmToArrayTrampoline or else panic.
Sourcepub fn unwrap_wasm_to_builtin_trampoline(self) -> BuiltinFunctionIndex
pub fn unwrap_wasm_to_builtin_trampoline(self) -> BuiltinFunctionIndex
Unwrap a FuncKey::WasmToBuiltinTrampoline or else panic.
Sourcepub fn unwrap_pulley_host_call(self) -> HostCall
pub fn unwrap_pulley_host_call(self) -> HostCall
Unwrap a FuncKey::PulleyHostCall or else panic.
Sourcepub fn unwrap_component_trampoline(self) -> (Abi, TrampolineIndex)
pub fn unwrap_component_trampoline(self) -> (Abi, TrampolineIndex)
Unwrap a FuncKey::ComponentTrampoline or else panic.
Sourcepub fn unwrap_resource_drop_trampoline(self)
pub fn unwrap_resource_drop_trampoline(self)
Unwrap a FuncKey::ResourceDropTrampoline or else panic.
Trait Implementations§
Source§impl Ord for FuncKey
impl Ord for FuncKey
Source§impl PartialOrd for FuncKey
impl PartialOrd for FuncKey
impl Copy for FuncKey
impl Eq for FuncKey
impl StructuralPartialEq for FuncKey
Auto Trait Implementations§
impl Freeze for FuncKey
impl RefUnwindSafe for FuncKey
impl Send for FuncKey
impl Sync for FuncKey
impl Unpin for FuncKey
impl UnwindSafe for FuncKey
Blanket Implementations§
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.