MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / val

Method val

crates/c-api/src/val.rs:122–138  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

120 }
121
122 pub fn val(&self) -> Val {
123 match self.kind {
124 WASM_I32 => Val::from(unsafe { self.of.i32 }),
125 WASM_I64 => Val::from(unsafe { self.of.i64 }),
126 WASM_F32 => Val::from(unsafe { self.of.f32 }),
127 WASM_F64 => Val::from(unsafe { self.of.f64 }),
128 #[cfg(feature = "gc")]
129 WASM_FUNCREF => unsafe {
130 if self.of.ref_.is_null() {
131 Val::FuncRef(None)
132 } else {
133 ref_to_val(&*self.of.ref_)
134 }
135 },
136 _ => crate::abort("unsupported val discriminant"),
137 }
138 }
139}
140
141#[unsafe(no_mangle)]

Callers 4

create_functionFunction · 0.80
wasm_func_callFunction · 0.80
wasm_global_newFunction · 0.80
wasm_global_setFunction · 0.80

Calls 5

fromFunction · 0.85
FuncRefClass · 0.85
ref_to_valFunction · 0.85
abortFunction · 0.85
is_nullMethod · 0.80

Tested by

no test coverage detected