Casts the value to the given data type, propagating exactness information.
(&self, data_type: &DataType)
| 310 | |
| 311 | /// Casts the value to the given data type, propagating exactness information. |
| 312 | pub fn cast_to(&self, data_type: &DataType) -> Result<Precision<ScalarValue>> { |
| 313 | match self { |
| 314 | Precision::Exact(value) => value.cast_to(data_type).map(Precision::Exact), |
| 315 | Precision::Inexact(value) => value.cast_to(data_type).map(Precision::Inexact), |
| 316 | Precision::Absent => Ok(Precision::Absent), |
| 317 | } |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | impl<T: Debug + Clone + PartialEq + Eq + PartialOrd> Debug for Precision<T> { |