mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-07 15:33:15 +00:00
Adds a number of utilities for working with boost::outcome::result combined with exception_container. The utilities are meant to help with migration of the existing code to use the boost::outcome::result: - `exception_container_throw_policy` - a NoValuePolicy meant to be used as a template parameter for the boost::outcome::result. It protects the caller of `result::value()` and `result::error()` methods - if the caller wishes to get a value but the result has an error (exception_container in our case), the exception in the container will be thrown instead. In case it's the other way around, boost::outcome::bad_result_access is thrown. - `result_parallel_for_each` - a version of `parallel_for_each` which is aware of results and returns a failed result in case any of the parallel invocations return a failed result. - `result_into_future` - converts a result into a future. If the result holds a value, converts it into make_ready_future; if it holds an exception, the exception is returned as make_exception_future. - `then_ok_result` takes a `future<T>` and converts it into a `future<result<T>>`. - `result_wrap` adapts a callable of type `T -> future<result<T>>` and returns a callable of type `result<T> -> future<result<T>>`.