uvco 0.1
|
#include <promise.h>
Classes | |
struct | PromiseAwaiter_ |
Handles the actual suspension and resumption. More... | |
Public Types | |
using | promise_type = Coroutine<void> |
Public Member Functions | |
Promise () | |
Promise ready to be awaited or fulfilled. | |
Promise (Promise< void > &&other) noexcept | |
Promise & | operator= (const Promise< void > &other) |
Promise & | operator= (Promise< void > &&other) noexcept |
Promise (const Promise< void > &other) | |
~Promise () | |
PromiseHandle< void > | handle () |
PromiseAwaiter_ | operator co_await () const |
bool | ready () const |
Returns whether the promise has already been fulfilled. | |
void | unwrap () |
Private Types | |
using | SharedCore_ = PromiseCore<void> * |
Private Member Functions | |
Promise (SharedCore_ core) | |
SharedCore_ & | core () |
Private Attributes | |
SharedCore_ | core_ |
Friends | |
class | Coroutine< void > |
template<typename... Ts> | |
class | SelectSet |
A void promise works slightly differently than a Promise<T>
in that it doesn't return a value. However, aside from return_void()
being implemented instead of return_value()
, the mechanics are identical.
using uvco::Promise< void >::promise_type = Coroutine<void> |
Part of the coroutine protocol: Promise<void>
is both return type and promise type.
|
private |
uvco::Promise< void >::Promise | ( | ) |
|
noexcept |
uvco::Promise< void >::Promise | ( | const Promise< void > & | other | ) |
uvco::Promise< void >::~Promise | ( | ) |
|
explicitprivate |
|
inlineprivate |
PromiseHandle< void > uvco::Promise< void >::handle | ( | ) |
Promise< void >::PromiseAwaiter_ uvco::Promise< void >::operator co_await | ( | ) | const |
Returns an awaiter object for the promise, handling actual suspension and resumption.
Promise< void > & uvco::Promise< void >::operator= | ( | const Promise< void > & | other | ) |
|
noexcept |
bool uvco::Promise< void >::ready | ( | ) | const |
Returns whether the promise has already been fulfilled.
void uvco::Promise< void >::unwrap | ( | ) |
|
friend |
|
friend |
|
private |