(ty: wasmtime::ValType)
| 302 | impl TryFrom<wasmtime::ValType> for DiffValueType { |
| 303 | type Error = &'static str; |
| 304 | fn try_from(ty: wasmtime::ValType) -> Result<Self, Self::Error> { |
| 305 | use wasmtime::ValType::*; |
| 306 | match ty { |
| 307 | I32 => Ok(Self::I32), |
| 308 | I64 => Ok(Self::I64), |
| 309 | F32 => Ok(Self::F32), |
| 310 | F64 => Ok(Self::F64), |
| 311 | V128 => Ok(Self::V128), |
| 312 | Ref(r) => match (r.is_nullable(), r.heap_type()) { |
| 313 | (true, HeapType::Func) => Ok(Self::FuncRef), |
| 314 | (true, HeapType::Extern) => Ok(Self::ExternRef), |
| 315 | (true, HeapType::Any) => Ok(Self::AnyRef), |
| 316 | (true, HeapType::I31) => Ok(Self::AnyRef), |
| 317 | (true, HeapType::None) => Ok(Self::AnyRef), |
| 318 | (true, HeapType::Exn) => Ok(Self::ExnRef), |
| 319 | (true, HeapType::Cont) => Ok(Self::ContRef), |
| 320 | _ => Err("non-null reference types are not supported yet"), |
| 321 | }, |
| 322 | } |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | /// Enumerate the types of v128. |
nothing calls this directly
no test coverage detected