Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::Goal::AwaitableFrameBase Class Reference
Inheritance diagram for nix::Goal::AwaitableFrameBase:
nix::Goal::AwaitableFrame< void > nix::Goal::AwaitableFrame< T > nix::Goal::AwaitableFrame< void >

Classes

struct  CoAwaiter< void >

Public Member Functions

InitialSuspend initial_suspend ()
FinalAwaiter final_suspend () noexcept
void unhandled_exception ()
template<typename T>
CoAwaiter< T > await_transform (Co< T > &&co)
template<typename T>
auto await_transform (AsyncCallback< T > &&acb)
SuspendAwaiter await_transform (Suspend)
ChildEventAwaiter await_transform (WaitForChildEvent)

Protected Attributes

std::optional< CoBase > continuation
void * resultSlot = nullptr
void(*) moveResult (AwaitableFrameBase *from, void *to) noexcept = nullptr
Goal * goal = nullptr
bool alive = true

Friends

struct Goal

Member Function Documentation

◆ await_transform() [1/2]

SuspendAwaiter nix::Goal::AwaitableFrameBase::await_transform ( Suspend )
inline

Allows awaiting a Suspend. Always suspends.

◆ await_transform() [2/2]

ChildEventAwaiter nix::Goal::AwaitableFrameBase::await_transform ( WaitForChildEvent )
inline

Allows awaiting child events (output, EOF, timeout).

◆ final_suspend()

FinalAwaiter nix::Goal::AwaitableFrameBase::final_suspend ( )
inlinenoexcept

Called on co_return. Creates FinalAwaiter which either jumps to continuation or suspends goal.

◆ initial_suspend()

InitialSuspend nix::Goal::AwaitableFrameBase::initial_suspend ( )
inline

Called by compiler generated code before body of coroutine. We use this opportunity to set the goal field and top_co field of Goal.

◆ unhandled_exception()

void nix::Goal::AwaitableFrameBase::unhandled_exception ( )
inline

If an exception is thrown inside a coroutine, we re-throw it in the context of the "resumer" of the continuation.

Member Data Documentation

◆ alive

bool nix::Goal::AwaitableFrameBase::alive = true
protected

Is set to false when destructed to ensure we don't use a destructed coroutine by accident

◆ continuation

std::optional<CoBase> nix::Goal::AwaitableFrameBase::continuation
protected

The coroutine that called us. It is what we "jump" to once we are done.

◆ goal

Goal* nix::Goal::AwaitableFrameBase::goal = nullptr
protected

The goal that we're a part of. Set either in Co::await_suspend or in constructor of Goal.


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