Decodes a raw register `value` of `etype` into a constant datum.
(
value: u64,
etype: ExprType,
constants: &[ConstantDatum],
heap: &Heap,
)
| 183 | |
| 184 | /// Decodes a raw register `value` of `etype` into a constant datum. |
| 185 | pub(crate) fn from_raw( |
| 186 | value: u64, |
| 187 | etype: ExprType, |
| 188 | constants: &[ConstantDatum], |
| 189 | heap: &Heap, |
| 190 | ) -> Self { |
| 191 | match etype { |
| 192 | ExprType::Boolean => Self::Boolean(value != 0), |
| 193 | ExprType::Double => Self::Double(f64::from_bits(value)), |
| 194 | ExprType::Integer => Self::Integer(value as i32), |
| 195 | ExprType::Text => { |
| 196 | let ptr = DatumPtr::from(value); |
| 197 | Self::Text(ptr.resolve_string(constants, heap).to_owned()) |
| 198 | } |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | /// A heap-allocated value used at runtime. |
nothing calls this directly
no test coverage detected