Try to map the inner value, returning an error if the function fails.
(
self,
f: F,
)
| 75 | |
| 76 | /// Try to map the inner value, returning an error if the function fails. |
| 77 | pub fn try_map<U, E, F: FnOnce(T) -> Result<U, E>>( |
| 78 | self, |
| 79 | f: F, |
| 80 | ) -> Result<SortOrderPushdownResult<U>, E> { |
| 81 | match self { |
| 82 | Self::Exact { inner } => { |
| 83 | Ok(SortOrderPushdownResult::Exact { inner: f(inner)? }) |
| 84 | } |
| 85 | Self::Inexact { inner } => { |
| 86 | Ok(SortOrderPushdownResult::Inexact { inner: f(inner)? }) |
| 87 | } |
| 88 | Self::Unsupported => Ok(SortOrderPushdownResult::Unsupported), |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | /// Convert this result to `Inexact`, downgrading `Exact` if present. |
| 93 | /// |
no outgoing calls
no test coverage detected