nixd
Loading...
Searching...
No Matches
nixd
include
nixd
Protocol
include/nixd/Protocol/Protocol.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <llvm/Support/JSON.h>
4
5
#include <cstdint>
6
#include <string>
7
8
namespace
nixd::rpc
{
9
10
enum class
LogLevel
{
11
Debug
,
12
Info
,
13
Warning
,
14
Error
,
15
};
16
17
struct
RegisterBCParams
{
18
std::string
Shm
;
19
std::string
BasePath
;
20
std::string
CachePath
;
21
std::int64_t
Size
;
22
};
23
24
llvm::json::Value
toJSON
(
const
RegisterBCParams
&Params);
25
bool
fromJSON
(
const
llvm::json::Value &Params,
RegisterBCParams
&R,
26
llvm::json::Path P);
27
28
struct
ExprValueParams
{
29
std::int64_t
ExprID
;
30
};
31
32
llvm::json::Value
toJSON
(
const
ExprValueParams
&Params);
33
bool
fromJSON
(
const
llvm::json::Value &Params,
ExprValueParams
&R,
34
llvm::json::Path P);
35
36
struct
ExprValueResponse
{
37
enum
ResultKinds
{
38
/// \brief The expr is not found in the registered bytecodes.
39
NotFound
,
40
41
/// \brief The expr is found, but the value is not evaluated. e.g. too deep
42
NotEvaluated
,
43
44
/// \brief Encountered an error when evaluating the value.
45
EvalError
,
46
47
/// \brief The value is available.
48
OK
,
49
};
50
int
ResultKind
;
51
/// \brief The value ID, for future reference.
52
///
53
/// We may want to query the value of the same expr multiple times, with more
54
/// detailed information.
55
std::int64_t
ValueID
;
56
57
/// \brief Opaque data, the value of the expr.
58
enum
ValueKinds
{
59
Int
,
60
Float
,
61
};
62
int
ValueKind
;
63
};
64
65
llvm::json::Value
toJSON
(
const
ExprValueResponse
&Params);
66
bool
fromJSON
(
const
llvm::json::Value &Params,
ExprValueResponse
&R,
67
llvm::json::Path P);
68
69
}
// namespace nixd::rpc
nixd::rpc
Definition
include/nixd/Protocol/Protocol.h:8
nixd::rpc::fromJSON
bool fromJSON(const llvm::json::Value &Params, RegisterBCParams &R, llvm::json::Path P)
nixd::rpc::toJSON
llvm::json::Value toJSON(const RegisterBCParams &Params)
Definition
lib/Protocol/Protocol.cpp:7
nixd::rpc::LogLevel
LogLevel
Definition
include/nixd/Protocol/Protocol.h:10
nixd::rpc::LogLevel::Warning
@ Warning
nixd::rpc::LogLevel::Info
@ Info
nixd::rpc::LogLevel::Error
@ Error
nixd::rpc::LogLevel::Debug
@ Debug
nixd::rpc::ExprValueParams
Definition
include/nixd/Protocol/Protocol.h:28
nixd::rpc::ExprValueParams::ExprID
std::int64_t ExprID
Definition
include/nixd/Protocol/Protocol.h:29
nixd::rpc::ExprValueResponse
Definition
include/nixd/Protocol/Protocol.h:36
nixd::rpc::ExprValueResponse::ValueKind
int ValueKind
Definition
include/nixd/Protocol/Protocol.h:62
nixd::rpc::ExprValueResponse::ValueKinds
ValueKinds
Opaque data, the value of the expr.
Definition
include/nixd/Protocol/Protocol.h:58
nixd::rpc::ExprValueResponse::Int
@ Int
Definition
include/nixd/Protocol/Protocol.h:59
nixd::rpc::ExprValueResponse::Float
@ Float
Definition
include/nixd/Protocol/Protocol.h:60
nixd::rpc::ExprValueResponse::ResultKind
int ResultKind
Definition
include/nixd/Protocol/Protocol.h:50
nixd::rpc::ExprValueResponse::ResultKinds
ResultKinds
Definition
include/nixd/Protocol/Protocol.h:37
nixd::rpc::ExprValueResponse::EvalError
@ EvalError
Encountered an error when evaluating the value.
Definition
include/nixd/Protocol/Protocol.h:45
nixd::rpc::ExprValueResponse::OK
@ OK
The value is available.
Definition
include/nixd/Protocol/Protocol.h:48
nixd::rpc::ExprValueResponse::NotFound
@ NotFound
The expr is not found in the registered bytecodes.
Definition
include/nixd/Protocol/Protocol.h:39
nixd::rpc::ExprValueResponse::NotEvaluated
@ NotEvaluated
The expr is found, but the value is not evaluated. e.g. too deep.
Definition
include/nixd/Protocol/Protocol.h:42
nixd::rpc::ExprValueResponse::ValueID
std::int64_t ValueID
The value ID, for future reference.
Definition
include/nixd/Protocol/Protocol.h:55
nixd::rpc::RegisterBCParams
Definition
include/nixd/Protocol/Protocol.h:17
nixd::rpc::RegisterBCParams::CachePath
std::string CachePath
Definition
include/nixd/Protocol/Protocol.h:20
nixd::rpc::RegisterBCParams::Shm
std::string Shm
Definition
include/nixd/Protocol/Protocol.h:18
nixd::rpc::RegisterBCParams::BasePath
std::string BasePath
Definition
include/nixd/Protocol/Protocol.h:19
nixd::rpc::RegisterBCParams::Size
std::int64_t Size
Definition
include/nixd/Protocol/Protocol.h:21
Generated by
1.12.0