pub enum FunctionKind {
Import(ImportedFunction),
Local(LocalFunction),
Uninitialized(TypeId),
}Expand description
The local- or external-specific bits of a function.
Variants§
Import(ImportedFunction)
An externally defined, imported wasm function.
Local(LocalFunction)
A locally defined wasm function.
Uninitialized(TypeId)
A locally defined wasm function that we haven’t parsed yet (but have
reserved its id and associated it with its original input wasm module
index). This should only exist within
ModuleFunctions::add_local_functions.
Implementations§
Source§impl FunctionKind
impl FunctionKind
Sourcepub fn unwrap_import(&self) -> &ImportedFunction
pub fn unwrap_import(&self) -> &ImportedFunction
Get the underlying FunctionKind::Import or panic if this is not an
import function
Sourcepub fn unwrap_local(&self) -> &LocalFunction
pub fn unwrap_local(&self) -> &LocalFunction
Get the underlying FunctionKind::Local or panic if this is not a local
function.
Sourcepub fn unwrap_import_mut(&mut self) -> &mut ImportedFunction
pub fn unwrap_import_mut(&mut self) -> &mut ImportedFunction
Get the underlying FunctionKind::Import or panic if this is not an
import function
Sourcepub fn unwrap_local_mut(&mut self) -> &mut LocalFunction
pub fn unwrap_local_mut(&mut self) -> &mut LocalFunction
Get the underlying FunctionKind::Local or panic if this is not a local
function.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FunctionKind
impl RefUnwindSafe for FunctionKind
impl Send for FunctionKind
impl Sync for FunctionKind
impl Unpin for FunctionKind
impl UnwindSafe for FunctionKind
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
Mutably borrows from an owned value. Read more