userver: userver/ugrpc/client/call_context.hpp Source File
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
10USERVER_NAMESPACE_BEGIN
11
12namespace ugrpc::client {
13
14namespace impl {
15class CallState;
16} // namespace impl
17
18/// @brief gRPC call context
20public:
21 /// @cond
22 // For internal use only
23 CallContext(utils::impl::InternalTag, impl::CallState& state) noexcept;
24 /// @endcond
25
26 /// @returns the `ClientContext` used for this RPC
27 grpc::ClientContext& GetClientContext();
28
29 /// @returns client name
30 std::string_view GetClientName() const noexcept;
31
32 /// @returns RPC name
33 std::string_view GetCallName() const noexcept;
34
35private:
36 impl::CallState& state_;
37};
38
39} // namespace ugrpc::client
40
41USERVER_NAMESPACE_END