COROIO: NNet::TFuture< void > Struct Reference
COROIO
 
Loading...
Searching...
No Matches
NNet::TFuture< void > Struct Reference

Future specialization for coroutines that return void. More...

#include <corochain.hpp>

Inheritance diagram for NNet::TFuture< void >:
NNet::TFutureBase< void > NNet::TFutureBase< void >

Public Member Functions

void await_resume ()
 
template<typename Func>
auto Accept (Func func) -> TFuture< void >
 Registers a continuation to be executed after the coroutine completes.
 
void await_resume ()
 
auto Apply (Func func) -> TFuture< decltype(func(std::declval< void >()))>
 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< void >
 TFutureBase (TPromise< void > &promise)
 
 TFutureBase (TFutureBase &&other)
 
 TFutureBase (const TFutureBase &)=delete
 
TFutureBaseoperator= (const TFutureBase &)=delete
 
TFutureBaseoperator= (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< void >
using promise_type
 
- Protected Attributes inherited from NNet::TFutureBase< void >
std::coroutine_handle< TPromise< void > > Coro
 

Detailed Description

Future specialization for coroutines that return void.

Member Function Documentation

◆ Accept()

template<typename Func>
auto NNet::TFuture< void >::Accept ( Func func) -> TFuture<void>
inline

Registers a continuation to be executed after the coroutine completes.

Template Parameters
FuncThe type of the continuation function.
Parameters
funcThe function to execute after completion.
Returns
TFuture<void> representing the continuation.

◆ Apply()

auto NNet::TFuture< void >::Apply ( Func func) -> TFuture<decltype(func(std::declval<void>()))>
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.

Template Parameters
FuncThe type of the function.
Parameters
funcThe function to apply.
Returns
A TFuture wrapping the result of the function call.

◆ Ignore()

TFuture< void > NNet::TFuture< void >::Ignore ( )
inline

Awaits the coroutine and ignores its result.

This is useful when the result is not needed.

Returns
TFuture<void> representing the completion.

The documentation for this struct was generated from the following file: