MCPcopy Create free account
hub / github.com/apache/datafusion / try_map

Method try_map

datafusion/physical-plan/src/sort_pushdown.rs:77–90  ·  view source on GitHub ↗

Try to map the inner value, returning an error if the function fails.

(
        self,
        f: F,
    )

Source from the content-addressed store, hash-verified

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 ///

Callers 5

try_pushdown_sortMethod · 0.80
try_pushdown_sortMethod · 0.80
try_pushdown_sortMethod · 0.80
try_pushdown_sortMethod · 0.80
try_pushdown_sortMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected