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

Method from

crates/c-api/src/types/val.rs:164–190  ·  view source on GitHub ↗
(r: HeapType)

Source from the content-addressed store, hash-verified

162
163impl From<HeapType> for wasmtime_heaptype_t {
164 fn from(r: HeapType) -> Self {
165 match r {
166 HeapType::Extern => Self::Extern,
167 HeapType::NoExtern => Self::NoExtern,
168 HeapType::Func => Self::Func,
169 HeapType::ConcreteFunc(f) => Self::ConcreteFunc(Box::new(wasm_functype_t::new(f))),
170 HeapType::NoFunc => Self::NoFunc,
171 HeapType::Any => Self::Any,
172 HeapType::None => Self::None,
173 HeapType::Eq => Self::Eq,
174 HeapType::I31 => Self::I31,
175 HeapType::Array => Self::Array,
176 HeapType::ConcreteArray(a) => {
177 Self::ConcreteArray(Box::new(wasmtime_array_type_t { ty: a }))
178 }
179 HeapType::Struct => Self::Struct,
180 HeapType::ConcreteStruct(s) => {
181 Self::ConcreteStruct(Box::new(wasmtime_struct_type_t { ty: s }))
182 }
183 HeapType::Exn => Self::Exn,
184 HeapType::ConcreteExn(e) => Self::ConcreteExn(Box::new(wasmtime_exn_type_t { ty: e })),
185 HeapType::NoExn => Self::NoExn,
186 HeapType::Cont | HeapType::ConcreteCont(_) | HeapType::NoCont => {
187 crate::abort("missing support for contref")
188 }
189 }
190 }
191}
192
193#[unsafe(no_mangle)]

Callers

nothing calls this directly

Calls 5

abortFunction · 0.85
is_nullableMethod · 0.80
heap_typeMethod · 0.80
newFunction · 0.50
cloneMethod · 0.45

Tested by

no test coverage detected