Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
Concepts.hpp
1#pragma once
2
3#include <boost/beast.hpp>
4#include <boost/beast/core/error.hpp>
5
6#include <concepts>
7#include <memory>
8#include <string>
9
10namespace web {
11
12struct ConnectionBase;
13
19template <typename T>
20concept SomeServerHandler = requires(
21 T handler,
22 std::string req,
23 std::shared_ptr<ConnectionBase> ws,
24 boost::beast::error_code ec
25) {
26 // the callback when server receives a request
27 { handler(req, ws) };
28};
29
33struct ServerTag {
34 virtual ~ServerTag() = default;
35};
36
42template <typename T>
43concept SomeServer = std::derived_from<T, ServerTag>;
44
45} // namespace web
Specifies the requirements a Webserver handler must fulfill.
Definition Concepts.hpp:20
Specifies a type that is a Server, i.e. derives from web::ServerTag.
Definition Concepts.hpp:43
This namespace implements the web server and related components.
Definition Types.hpp:23
Base class for all connections.
Definition ConnectionBase.hpp:25
A tag class for server to help identify Server in templated code.
Definition Concepts.hpp:33