Computes the width of this interval; i.e. the difference between its bounds. For unbounded intervals, this function will return a `NULL` `ScalarValue` If the underlying data type doesn't support subtraction, this function will return an error.
(&self)
| 892 | /// `ScalarValue` If the underlying data type doesn't support subtraction, |
| 893 | /// this function will return an error. |
| 894 | pub fn width(&self) -> Result<ScalarValue> { |
| 895 | let dt = self.data_type(); |
| 896 | let width_dt = |
| 897 | BinaryTypeCoercer::new(&dt, &Operator::Minus, &dt).get_result_type()?; |
| 898 | Ok(sub_bounds::<true>(&width_dt, &self.upper, &self.lower)) |
| 899 | } |
| 900 | |
| 901 | /// Returns the cardinality of this interval, which is the number of all |
| 902 | /// distinct points inside it. This function returns `None` if: |
no test coverage detected