3#include <userver/ugrpc/server/rpc.hpp>
7namespace ugrpc::
server::impl {
9struct NoInitialRequest
final {};
11enum class CallCategory {
18template <
typename HandlerMethod>
21template <
typename ServiceBaseType,
typename RequestType,
typename ResponseType>
22struct CallTraits<
void (ServiceBaseType::*)(UnaryCall<ResponseType>&,
25 using ServiceBase = ServiceBaseType;
26 using Request = RequestType;
27 using Response = ResponseType;
28 using RawCall = impl::RawResponseWriter<ResponseType>;
29 using InitialRequest = Request;
30 using Call = UnaryCall<Response>;
31 using ServiceMethod =
void (ServiceBase::*)(Call&, Request&&);
32 static constexpr auto kCallCategory = CallCategory::kUnary;
35template <
typename ServiceBaseType,
typename RequestType,
typename ResponseType>
36struct CallTraits<
void (ServiceBaseType::*)(
37 InputStream<RequestType, ResponseType>&)>
39 using ServiceBase = ServiceBaseType;
40 using Request = RequestType;
41 using Response = ResponseType;
42 using RawCall = impl::RawReader<Request, Response>;
43 using InitialRequest = NoInitialRequest;
44 using Call = InputStream<Request, Response>;
45 using ServiceMethod =
void (ServiceBase::*)(Call&);
46 static constexpr auto kCallCategory = CallCategory::kInputStream;
49template <
typename ServiceBaseType,
typename RequestType,
typename ResponseType>
50struct CallTraits<
void (ServiceBaseType::*)(OutputStream<ResponseType>&,
53 using ServiceBase = ServiceBaseType;
54 using Request = RequestType;
55 using Response = ResponseType;
56 using RawCall = impl::RawWriter<Response>;
57 using InitialRequest = Request;
58 using Call = OutputStream<Response>;
59 using ServiceMethod =
void (ServiceBase::*)(Call&, Request&&);
60 static constexpr auto kCallCategory = CallCategory::kOutputStream;
63template <
typename ServiceBaseType,
typename RequestType,
typename ResponseType>
64struct CallTraits<
void (ServiceBaseType::*)(
67 using ServiceBase = ServiceBaseType;
68 using Request = RequestType;
69 using Response = ResponseType;
70 using RawCall = impl::RawReaderWriter<Request, Response>;
71 using InitialRequest = NoInitialRequest;
73 using ServiceMethod =
void (ServiceBase::*)(Call&);
74 static constexpr auto kCallCategory = CallCategory::kBidirectionalStream;