Enum walrus::FunctionKind
source · 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 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