aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/worker-protocol-impl.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/worker-protocol-impl.hh')
-rw-r--r--src/libstore/worker-protocol-impl.hh16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libstore/worker-protocol-impl.hh b/src/libstore/worker-protocol-impl.hh
index d3d2792ff..4f797f95a 100644
--- a/src/libstore/worker-protocol-impl.hh
+++ b/src/libstore/worker-protocol-impl.hh
@@ -75,4 +75,20 @@ void WorkerProto::Serialise<std::map<K, V>>::write(const Store & store, WorkerPr
}
}
+template<typename... Ts>
+std::tuple<Ts...> WorkerProto::Serialise<std::tuple<Ts...>>::read(const Store & store, WorkerProto::ReadConn conn)
+{
+ return std::tuple<Ts...> {
+ WorkerProto::Serialise<Ts>::read(store, conn)...,
+ };
+}
+
+template<typename... Ts>
+void WorkerProto::Serialise<std::tuple<Ts...>>::write(const Store & store, WorkerProto::WriteConn conn, const std::tuple<Ts...> & res)
+{
+ std::apply([&]<typename... Us>(const Us &... args) {
+ (WorkerProto::Serialise<Us>::write(store, conn, args), ...);
+ }, res);
+}
+
}