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
17template <typename T>
18concept SomeServerHandler = requires(
19 T handler,
20 std::string req,
21 std::shared_ptr<ConnectionBase> ws,
22 boost::beast::error_code ec
23) {
24 // the callback when server receives a request
25 { handler(req, ws) };
26};
27
31struct ServerTag {
32 virtual ~ServerTag() = default;
33};
34
35template <typename T>
36concept SomeServer = std::derived_from<T, ServerTag>;
37
38} // namespace web
Specifies the requirements a Webserver handler must fulfill.
Definition Concepts.hpp:18
Definition Concepts.hpp:36
This namespace implements the web server and related components.
Definition Types.hpp:24
Base class for all connections.
Definition ConnectionBase.hpp:25
A tag class for server to help identify Server in templated code.
Definition Concepts.hpp:31