Pigweed
 
Loading...
Searching...
No Matches
pw::async2::PendFuncAwaitable< T, Func > Class Template Reference

#include <pend_func_awaitable.h>

Public Types

using CallableType = Func
 

Public Member Functions

constexpr PendFuncAwaitable (Func &&func)
 
Poll< T > Pend (pw::async2::Context &cx)
 

Detailed Description

template<typename T, typename Func = Function<Poll<T>(Context&)>>
class pw::async2::PendFuncAwaitable< T, Func >

A co-awaitable object that delegates to a provided func.

Thie provided func may be any callable (function, lambda, or similar) which accepts a Context& and returns a Poll<T>.

Constructor & Destructor Documentation

◆ PendFuncAwaitable()

template<typename T , typename Func = Function<Poll<T>(Context&)>>
constexpr pw::async2::PendFuncAwaitable< T, Func >::PendFuncAwaitable ( Func &&  func)
inlineconstexpr

Create a new objectwhich delegatesPendtopendable`.

See class docs for more details.

Member Function Documentation

◆ Pend()

template<typename T , typename Func = Function<Poll<T>(Context&)>>
Poll< T > pw::async2::PendFuncAwaitable< T, Func >::Pend ( pw::async2::Context cx)
inline

Delegates to the stored func to get a result T or wait.

This method will be called if the object is used by co_await.


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