JSON-RPC 2.0
JSON-RPC 2.0 Modern C++ Library
Loading...
Searching...
No Matches
jsonrpc::endpoint Namespace Reference

Classes

class  Dispatcher
 
class  PendingRequest
 A class representing a pending RPC request. More...
 
class  Request
 
class  Response
 
class  RpcEndpoint
 
class  TypedMethodHandler
 
class  TypedNotificationHandler
 

Concepts

concept  FromJson
 
concept  ToJson
 
concept  JsonConvertible
 
concept  NotJsonLike
 
concept  HasMessageMethod
 

Typedefs

using RequestId = std::variant<int64_t, std::string>
 
using MethodCallHandler
 
using NotificationHandler = void(const std::optional<nlohmann::json>& params)
 
using Handler = std::variant<MethodCallHandler, NotificationHandler>
 

Variables

constexpr std::string_view kJsonRpcVersion = "2.0"
 
constexpr auto kDefaultRequestTimeout = std::chrono::milliseconds(30000)
 
constexpr size_t kDefaultMaxBatchSize = 100
 

Typedef Documentation

◆ Handler

Definition at line 22 of file types.hpp.

◆ MethodCallHandler

Initial value:
nlohmann::json(const std::optional<nlohmann::json>& params)

Definition at line 17 of file types.hpp.

◆ NotificationHandler

using jsonrpc::endpoint::NotificationHandler = void(const std::optional<nlohmann::json>& params)

Definition at line 20 of file types.hpp.

◆ RequestId

using jsonrpc::endpoint::RequestId = std::variant<int64_t, std::string>

Definition at line 15 of file types.hpp.

Variable Documentation

◆ kDefaultMaxBatchSize

size_t jsonrpc::endpoint::kDefaultMaxBatchSize = 100
constexpr

Definition at line 26 of file types.hpp.

◆ kDefaultRequestTimeout

auto jsonrpc::endpoint::kDefaultRequestTimeout = std::chrono::milliseconds(30000)
constexpr

Definition at line 24 of file types.hpp.

◆ kJsonRpcVersion