userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
call_context.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/ugrpc/client/call_context.hpp
4
/// @brief @copybrief ugrpc::client::CallContext
5
6
#
include
<
grpcpp
/
client_context
.
h
>
7
8
#
include
<
userver
/
utils
/
impl
/
internal_tag_fwd
.
hpp
>
9
10
USERVER_NAMESPACE_BEGIN
11
12
namespace
ugrpc::client {
13
14
namespace
impl {
15
class
CallState;
16
}
// namespace impl
17
18
/// @brief gRPC call context
19
class
CallContext
{
20
public
:
21
/// @cond
22
// For internal use only
23
CallContext(
utils
::impl::InternalTag, impl::CallState& state)
noexcept
;
24
/// @endcond
25
26
/// @brief Returns the context of the last RPC attempt.
27
///
28
/// For unary RPCs, the call must have completed successfully or with @ref ugrpc::client::ErrorWithStatus.
29
/// Metadata access must follow the preconditions of the respective gRPC accessor.
30
grpc::ClientContext&
GetClientContext
();
31
32
/// @returns client name
33
std::string_view
GetClientName
()
const
noexcept
;
34
35
/// @returns RPC name
36
std::string_view
GetCallName
()
const
noexcept
;
37
38
private
:
39
impl::CallState& state_;
40
};
41
42
}
// namespace ugrpc::client
43
44
USERVER_NAMESPACE_END
userver
ugrpc
client
call_context.hpp
Generated on
for userver by
Doxygen
1.17.0