16 std::is_default_constructible<T>::value,
17 "Result can only wrap default constructible types."
25 Result(T _value) : value(std::move(_value)), error() {}
31 Result(
const arrow::Status& status) : value(), error(status) {}
34 Result(arrow::Status&& status) : value(), error(std::move(status)) {}
45 return error.is_err();
48#ifdef __cpp_exceptions
50 const T& value_or_throw() const& {
51 error.throw_on_failure();
56 T value_or_throw() && {
57 error.throw_on_failure();
58 return std::move(value);
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:91
A class for representing either a usable value, or an error.
Definition result.hpp:14
Result(const arrow::Status &status)
Construct a result from an arrow status, default constructing the value.
Definition result.hpp:31
Result()=delete
Don't allow uninitialized results.
bool is_ok() const
Returns true if error is set to rerun::ErrorCode::Ok, implying that a value is contained,...
Definition result.hpp:38
bool is_err() const
Returns true if error is not set to rerun::ErrorCode::Ok, implying that no value is contained,...
Definition result.hpp:44
Result(rerun::Error _error)
Construct a result from an error, default constructing the value.
Definition result.hpp:28
Result(arrow::Status &&status)
Construct a result from an arrow status, default constructing the value.
Definition result.hpp:34
Result(T _value)
Construct a result from a value, setting error to ok.
Definition result.hpp:25
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22