61 return mResult.template is<T>();
68 explicit operator bool()
const {
79 static const T empty{};
105 static const Error empty_error(
"No error - result contains success value");
120 const fl::variant<T, Error>&
variant()
const {
const T & value() const
Get the success value (const)
PromiseResult(Error &&error)
Construct an error PromiseResult (move)
bool ok() const
Check if the result is successful.
PromiseResult(const T &value)
Construct a successful PromiseResult.
PromiseResult(T &&value)
Construct a successful PromiseResult (move)
fl::variant< T, Error > mResult
const fl::variant< T, Error > & variant() const
Access the underlying variant (for advanced usage)
T & value()
Get the success value (mutable)
PromiseResult(const Error &error)
Construct an error PromiseResult.
const Error & error() const
Get the error value.
fl::string error_message() const
Get the error message as a convenience.
Result type for promise operations.
constexpr remove_reference< T >::type && move(T &&t) FL_NOEXCEPT
PromiseResult< T > make_success(const T &value)
Helper function to create a successful result.
PromiseResult< T > make_error(const Error &error)
Helper function to create an error result.
constexpr remove_reference< T >::type && move(T &&t) FL_NOEXCEPT
constexpr int type_rank< T >::value
pair_element< I, T1, T2 >::type & get(pair< T1, T2 > &p) FL_NOEXCEPT
Base definition for an LED controller.
Promise-based fluent API for FastLED - standalone async primitives.