about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/store-api.hh
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libstore/store-api.hh')
-rw-r--r--third_party/nix/src/libstore/store-api.hh9
1 files changed, 9 insertions, 0 deletions
diff --git a/third_party/nix/src/libstore/store-api.hh b/third_party/nix/src/libstore/store-api.hh
index c6f8d75b67..f5076e458d 100644
--- a/third_party/nix/src/libstore/store-api.hh
+++ b/third_party/nix/src/libstore/store-api.hh
@@ -8,6 +8,7 @@
 #include <unordered_map>
 #include <unordered_set>
 
+#include "libproto/worker.pb.h"
 #include "libstore/crypto.hh"
 #include "libstore/globals.hh"
 #include "libutil/config.hh"
@@ -181,6 +182,10 @@ typedef std::list<ValidPathInfo> ValidPathInfos;
 
 enum BuildMode { bmNormal, bmRepair, bmCheck };
 
+// Convert the proto version of a `nix::proto::BuildMode` to its corresponding
+// nix `BuildMode`
+std::optional<BuildMode> build_mode_from(nix::proto::BuildMode mode);
+
 struct BuildResult {
   /* Note: don't remove status codes, and only add new status codes
      at the end of the list, to prevent client/server
@@ -218,6 +223,10 @@ struct BuildResult {
   bool success() {
     return status == Built || status == Substituted || status == AlreadyValid;
   }
+
+  // Convert the status of this `BuildResult` to its corresponding
+  // `nix::proto::BuildStatus`
+  nix::proto::BuildStatus status_to_proto();
 };
 
 class Store : public std::enable_shared_from_this<Store>, public Config {