nixd
Loading...
Searching...
No Matches
lib/Protocol/Protocol.cpp
Go to the documentation of this file.
2
3namespace nixd::rpc {
4
5using namespace llvm::json;
6
8 return Object{{"Shm", Params.Shm},
9 {"BasePath", Params.BasePath},
10 {"CachePath", Params.CachePath},
11 {"Size", Params.Size}};
12}
13
14bool fromJSON(const Value &Params, RegisterBCParams &R, Path P) {
15 ObjectMapper O(Params, P);
16 return O && O.map("Shm", R.Shm) && O.map("BasePath", R.BasePath) &&
17 O.map("CachePath", R.CachePath) && O.map("Size", R.Size);
18}
19
21 return Object{{"ExprID", Params.ExprID}};
22}
23
24bool fromJSON(const Value &Params, ExprValueParams &R, Path P) {
25 ObjectMapper O(Params, P);
26 return O && O.map("ExprID", R.ExprID);
27}
28
30 return Object{{"ResultKind", Params.ResultKind},
31 {"ValueID", Params.ValueID},
32 {"ValueKind", Params.ValueKind}};
33}
34
35bool fromJSON(const Value &Params, ExprValueResponse &R, Path P) {
36 ObjectMapper O(Params, P);
37 return O && O.map("ResultKind", R.ResultKind) &&
38 O.map("ValueID", R.ValueID) && O.map("ValueKind", R.ValueKind);
39}
40
41} // namespace nixd::rpc
std::string Path
Definition Path.h:24
bool fromJSON(const llvm::json::Value &Params, RegisterBCParams &R, llvm::json::Path P)
llvm::json::Value toJSON(const RegisterBCParams &Params)
std::int64_t ValueID
The value ID, for future reference.