Implement public interface.
| 88 | |
| 89 | // Implement public interface. |
| 90 | void Record(int64_t expr_id, const Value& value) override { |
| 91 | auto value_or = interop_internal::ToLegacyValue(&arena_, value); |
| 92 | |
| 93 | if (!value_or.ok()) { |
| 94 | // TODO(uncreated-issue/65): Use pointer identity for UnsupportedConversionError |
| 95 | // as a sentinel value. The legacy CEL value just wraps the error pointer. |
| 96 | // This can be removed after the value migration is complete. |
| 97 | RecordImpl(expr_id, CelValue::CreateError(&UnsupportedConversionError())); |
| 98 | } else { |
| 99 | return RecordImpl(expr_id, *value_or); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | void RecordLegacyValue(int64_t expr_id, const CelValue& value) override { |
| 104 | return RecordImpl(expr_id, value); |