userver: userver/ugrpc/rpc_type.hpp Source File
Loading...
Searching...
No Matches
rpc_type.hpp
Go to the documentation of this file.
1#pragma once
2
5
6USERVER_NAMESPACE_BEGIN
7
8namespace ugrpc {
9
11enum class RpcType {
12 kUnary,
13 kClientStreaming,
14 kServerStreaming,
15 kBidiStreaming,
16};
17
19constexpr bool IsSingleRequestMethod(RpcType rpc_type) noexcept {
20 return RpcType::kUnary == rpc_type || RpcType::kServerStreaming == rpc_type;
21}
22
24constexpr bool IsSingleResponseMethod(RpcType rpc_type) noexcept {
25 return RpcType::kUnary == rpc_type || RpcType::kClientStreaming == rpc_type;
26}
27
28} // namespace ugrpc
29
30USERVER_NAMESPACE_END