![]() |
Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
|
#include <goal.hh>
Public Member Functions | |
| Co (HandleType< T > h) noexcept | |
| AwaitableFrame< T > & | frame () const |
| Public Member Functions inherited from nix::Goal::CoBase | |
| CoBase (CoBase &&rhs) noexcept | |
| CoBase & | operator= (CoBase &&rhs) noexcept |
| CoBase (const CoBase &)=delete | |
| CoBase & | operator= (const CoBase &)=delete |
Additional Inherited Members | |
| Protected Member Functions inherited from nix::Goal::CoBase | |
| CoBase (std::coroutine_handle<> h) noexcept | |
| Protected Attributes inherited from nix::Goal::CoBase | |
| std::coroutine_handle | handle |
C++20 coroutine wrapper for use in goal logic. Coroutines are functions that use co_await/co_return (and co_yield, but not supported by Co).
Co is meant to be used by methods of subclasses of Goal. The main functionality provided by Co is
The idea is that you implement the goal logic using coroutines, and do the core thing a goal can do, suspension, when you have children you're waiting for. Coroutines allow you to resume the work cleanly.