If we have some value (exact or inexact), it returns that value. Otherwise, it returns `None`.
(&self)
| 64 | /// If we have some value (exact or inexact), it returns that value. |
| 65 | /// Otherwise, it returns `None`. |
| 66 | pub fn get_value(&self) -> Option<&T> { |
| 67 | match self { |
| 68 | Precision::Exact(value) | Precision::Inexact(value) => Some(value), |
| 69 | Precision::Absent => None, |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | /// Transform the value in this [`Precision`] object, if one exists, using |
| 74 | /// the given function. Preserves the exactness state. |
no outgoing calls