Future type for coroutines returning a value of type T. More...
#include <corochain.hpp>
Public Member Functions | |
| T | await_resume () |
| template<typename Func > | |
| auto | Apply (Func func) -> TFuture< decltype(func(std::declval< T >()))> |
| Applies a function to the result of the coroutine. | |
| TFuture< void > | Ignore () |
| Awaits the coroutine and ignores its result. | |
Public Member Functions inherited from NNet::TFutureBase< T > | |
| TFutureBase (TPromise< T > &promise) | |
| TFutureBase (TFutureBase &&other) | |
| TFutureBase (const TFutureBase &)=delete | |
| TFutureBase & | operator= (const TFutureBase &)=delete |
| TFutureBase & | operator= (TFutureBase &&other) |
| bool | await_ready () const |
| bool | done () const |
| std::coroutine_handle | raw () |
| void | await_suspend (std::coroutine_handle<> caller) |
Additional Inherited Members | |
Public Types inherited from NNet::TFutureBase< T > | |
| using | promise_type = TPromise< T > |
Protected Attributes inherited from NNet::TFutureBase< T > | |
| std::coroutine_handle< TPromise< T > > | Coro = nullptr |
Future type for coroutines returning a value of type T.
Provides mechanisms to await and retrieve the result of a coroutine.
| T | The type of the result. |
|
inline |
Applies a function to the result of the coroutine.
The provided function is applied to the result, and the outcome is wrapped in a new future.
| Func | The type of the function. |
| func | The function to apply. |
|
inline |
Awaits the coroutine and ignores its result.
This is useful when the result is not needed.