Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::UiTask Class Reference

Lazy move-only coroutine frame, created and released on its creating UI thread. The task owns its function parameters, never a captured coroutine lambda's closure. Direct low-level use requires a free/static coroutine function with owning parameters; ui::async separately retains its callable until the entire frame is destroyed. Allocation in the calling expression can throw before start(); no work runs until successful adoption. Only this adapter's awaiters are supported. A suspended task must not retain widget/view borrows. More...

#include <async.hpp>

Classes

struct  promise_type
 Compiler-facing coroutine promise; not an independent execution API. More...

Public Member Functions

 UiTask ()=default
 Empty task.
 ~UiTask ()
 Destroy an unadopted frame on its creating thread; foreign destruction terminates.
 UiTask (UiTask &&other) noexcept
UiTask & operator= (UiTask &&other) noexcept
 UiTask (const UiTask &)=delete
UiTask & operator= (const UiTask &)=delete

Friends

class UiAsync

Detailed Description

Lazy move-only coroutine frame, created and released on its creating UI thread. The task owns its function parameters, never a captured coroutine lambda's closure. Direct low-level use requires a free/static coroutine function with owning parameters; ui::async separately retains its callable until the entire frame is destroyed. Allocation in the calling expression can throw before start(); no work runs until successful adoption. Only this adapter's awaiters are supported. A suspended task must not retain widget/view borrows.

Constructor & Destructor Documentation

◆ UiTask()

portals::UiTask::UiTask ( UiTask && other)
noexcept
Parameters
otherLazy owner to transfer; other becomes empty.

Member Function Documentation

◆ operator=()

UiTask & portals::UiTask::operator= ( UiTask && other)
noexcept
Parameters
otherLazy owner to transfer after releasing this frame on its creating thread.
Returns
This task; self-assignment is a no-op.

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