-
#include "tensorstore/util/future.h"
-
template <typename Executor, typename T, typename Func>
requires std::is_convertible_v<
std::invoke_result_t<Func&&, absl::Status>,
Result<T>>
Future<T> tensorstore::MapFutureError(Executor&& executor,
Func func,
Future<T> future); Transforms the error status of a Future.
Example:
Future<int> future = ...; auto mapped_future = MapFutureError( InlineExecutor{}, [](const absl::Status& status) -> Result<int> { return status.Annotate("Error doing xxx"); }, future);