aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/derivation-goal.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/build/derivation-goal.hh')
-rw-r--r--src/libstore/build/derivation-goal.hh14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/libstore/build/derivation-goal.hh b/src/libstore/build/derivation-goal.hh
index da935ceb5..f7d86ed2e 100644
--- a/src/libstore/build/derivation-goal.hh
+++ b/src/libstore/build/derivation-goal.hh
@@ -14,7 +14,19 @@ using std::map;
struct HookInstance;
-typedef enum {rpAccept, rpDecline, rpPostpone} HookReply;
+struct HookReplyBase {
+ struct [[nodiscard]] Accept {};
+ struct [[nodiscard]] Decline {};
+ struct [[nodiscard]] Postpone {};
+};
+
+struct [[nodiscard]] HookReply
+ : HookReplyBase,
+ std::variant<HookReplyBase::Accept, HookReplyBase::Decline, HookReplyBase::Postpone>
+{
+ HookReply() = delete;
+ using variant::variant;
+};
/**
* Unless we are repairing, we don't both to test validity and just assume it,