FastLED 3.10.6
Loading...
Searching...
No Matches

◆ reject()

template<typename T>
bool fl::task::detail::PromiseImpl< T >::reject ( const Error & error)
inline

Reject Promise with error.

Definition at line 307 of file promise.h.

307 {
308 if (state() != PromiseState_t::PENDING) return false;
309
310 mError = error;
312
315 }
316
317 return true;
318 }
fl::function< void(const Error &)> mCatchCallback
Definition promise.h:351
const Error & error() const FL_NO_EXCEPT
Get error (only valid if rejected)
Definition promise.h:341
void process_callbacks() FL_NO_EXCEPT
Process pending callbacks.
Definition promise.h:366
PromiseState_t state() const FL_NO_EXCEPT
Read the state atomically.
Definition promise.h:356
void set_state(PromiseState_t s) FL_NO_EXCEPT
Write the state atomically.
Definition promise.h:361
Implementation class for Promise - holds the actual state and logic.
Definition promise.h:245

References error(), fl::FL_NO_EXCEPT, mCallbacksProcessed, mCatchCallback, mError, fl::task::detail::PENDING, process_callbacks(), fl::task::detail::REJECTED, set_state(), and state().

+ Here is the call graph for this function: