JSON-RPC 2.0
JSON-RPC 2.0 Modern C++ Library
Loading...
Searching...
No Matches
types.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4#include <optional>
5#include <variant>
6
7#include <nlohmann/json.hpp>
8
9namespace jsonrpc::server {
10
18 std::function<nlohmann::json(const std::optional<nlohmann::json> &)>;
19
27 std::function<void(const std::optional<nlohmann::json> &)>;
28
33using Handler = std::variant<MethodCallHandler, NotificationHandler>;
34
35} // namespace jsonrpc::server
std::function< void(const std::optional< nlohmann::json > &)> NotificationHandler
Type alias for notification handler functions.
Definition types.hpp:26
std::variant< MethodCallHandler, NotificationHandler > Handler
Type alias for a handler which can be either a method call handler or a notification handler.
Definition types.hpp:33
std::function< nlohmann::json(const std::optional< nlohmann::json > &)> MethodCallHandler
Type alias for method call handler functions.
Definition types.hpp:17