MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / from

Method from

crates/tinywasm/src/interpreter/values.rs:116–126  ·  view source on GitHub ↗
(value: &WasmValue)

Source from the content-addressed store, hash-verified

114
115impl From<&WasmValue> for TinyWasmValue {
116 fn from(value: &WasmValue) -> Self {
117 match value {
118 WasmValue::I32(v) => Self::Value32(*v as u32),
119 WasmValue::I64(v) => Self::Value64(*v as u64),
120 WasmValue::F32(v) => Self::Value32(v.to_bits()),
121 WasmValue::F64(v) => Self::Value64(v.to_bits()),
122 WasmValue::RefExtern(v) => Self::ValueRef(ValueRef::from_addr(v.addr())),
123 WasmValue::RefFunc(v) => Self::ValueRef(ValueRef::from_addr(v.addr())),
124 WasmValue::V128(v) => Self::Value128((*v).into()),
125 }
126 }
127}
128
129impl From<WasmValue> for TinyWasmValue {

Callers

nothing calls this directly

Calls 3

ValueRefClass · 0.85
Value128Class · 0.85
addrMethod · 0.45

Tested by

no test coverage detected