Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::AsyncReceive< T > Class Template Reference

Owning typed data awaiter; normally obtained through UiAsyncContext::receive. More...

#include <async.hpp>

Public Member Functions

constexpr bool await_ready () const noexcept
bool await_suspend (std::coroutine_handle< UiTask::promise_type > frame)
std::expected< std::shared_ptr< const T >, AsyncError > await_resume () noexcept

Friends

class UiAsyncContext
struct ui::detail::MessageAccess

Detailed Description

template<class T>
class portals::AsyncReceive< T >

Owning typed data awaiter; normally obtained through UiAsyncContext::receive.

Template Parameters
TTransitively immutable shared result type, safe to release on producer or UI threads.

Member Function Documentation

◆ await_ready()

template<class T>
bool portals::AsyncReceive< T >::await_ready ( ) const
inlineconstexprnoexcept
Returns
False: all completions enter through the existing scheduler.

◆ await_resume()

template<class T>
std::expected< std::shared_ptr< const T >, AsyncError > portals::AsyncReceive< T >::await_resume ( )
inlinenoexcept
Returns
Owning immutable result or typed registration/provider/cancellation failure.

◆ await_suspend()

template<class T>
bool portals::AsyncReceive< T >::await_suspend ( std::coroutine_handle< UiTask::promise_type > frame)
inline
Parameters
frameCurrently executing adopted UI coroutine.
Returns
True when suspended; false when registration/start failed or cancellation occurred.

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