Encode this block argument as a `Value` for storage in the value pool. Internal to `BlockCall`, must not be used elsewhere to avoid exposing the raw bit encoding.
(&self)
| 220 | /// value pool. Internal to `BlockCall`, must not be used |
| 221 | /// elsewhere to avoid exposing the raw bit encoding. |
| 222 | fn encode_as_value(&self) -> Value { |
| 223 | let (tag, payload) = match *self { |
| 224 | BlockArg::Value(v) => (0, v.as_bits()), |
| 225 | BlockArg::TryCallRet(i) => (1, i), |
| 226 | BlockArg::TryCallExn(i) => (2, i), |
| 227 | }; |
| 228 | assert!(payload < (1 << 30)); |
| 229 | let raw = (tag << 30) | payload; |
| 230 | Value::from_bits(raw) |
| 231 | } |
| 232 | |
| 233 | /// Decode a raw `Value` encoding of this block argument. |
| 234 | fn decode_from_value(v: Value) -> Self { |
no test coverage detected