- Qt 6.12
- Qt GRPC
- C++ Classes
- QGrpcInterceptionContext
- Qt 6.12.0 Reference Documentation

# QGrpcInterceptionContext Class

Provides contextual information to interceptor callbacks. More...

Header: | `#include <QGrpcInterceptor>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS Grpc)` `target_link_libraries(mytarget PRIVATE Qt6::Grpc)`
Since: | Qt 6.11

- List of all members, including inherited members
- QGrpcInterceptionContext is part of Qt GRPC Interceptors.

## Public Functions

| QGrpcInterceptionContext(const QGrpcInterceptionContext &)
| QGrpcInterceptionContext(QGrpcInterceptionContext &&)
| ~QGrpcInterceptionContext()
const QGrpcCallOptions & | callOptions() const &
const QAbstractGrpcChannel & | channel() const &
QtGrpc::RpcDescriptor | descriptor() const
quint64 | operationId() const
quint32 | version() const
QGrpcInterceptionContext & | operator=(QGrpcInterceptionContext &&)
QGrpcInterceptionContext & | operator=(const QGrpcInterceptionContext &)

## Detailed Description

QGrpcInterceptionContext is passed to interceptor callbacks and provides access to information about the intercepted RPC, such as the channel, the RPC descriptor, or call options.

A QGrpcInterceptionContext instance is created by Qt GRPC for each callback invocation. The context object is only valid for the duration of the callback and must not be stored.

Note: QGrpcInterceptionContext is not copyable or movable.

See also QGrpcStartInterceptor, QGrpcInitialMetadataInterceptor, QGrpcMessageReceivedInterceptor, QGrpcWriteMessageInterceptor, QGrpcWritesDoneInterceptor, QGrpcTrailingMetadataInterceptor, QGrpcFinishedInterceptor, and QGrpcCancelInterceptor.

## Member Function Documentation

### `[delete]` QGrpcInterceptionContext::QGrpcInterceptionContext(const QGrpcInterceptionContext &)

Copy-constructs an instance of QGrpcInterceptionContext. This function is deleted.

### `[delete]` QGrpcInterceptionContext::QGrpcInterceptionContext(QGrpcInterceptionContext &&)

Move-constructs an instance of QGrpcInterceptionContext. This function is deleted.

### `[constexpr noexcept default]` QGrpcInterceptionContext::~QGrpcInterceptionContext()

Destroys the instance of QGrpcInterceptionContext.

### `[noexcept]` const QGrpcCallOptions &QGrpcInterceptionContext::callOptions() const &

Returns the call options that are in effect for the intercepted RPC.

### `[noexcept]` const QAbstractGrpcChannel &QGrpcInterceptionContext::channel() const &

Returns the channel used for the intercepted RPC.

### `[noexcept]` QtGrpc::RpcDescriptor QGrpcInterceptionContext::descriptor() const

Returns the descriptor identifying the intercepted RPC.

### `[noexcept]` quint64 QGrpcInterceptionContext::operationId() const

Returns the unique identifier of the intercepted call.

Each ID is unique across all channels for the application lifetime.

This identifier can be used to correlate interception callbacks that belong to the same RPC operation across multiple hook points.

### `[noexcept]` quint32 QGrpcInterceptionContext::version() const

Returns the version of the interception context.

Future versions of Qt may extend QGrpcInterceptionContext. This function can be used to identify the supported revision of the context.

### `[delete]` QGrpcInterceptionContext &QGrpcInterceptionContext::operator=(QGrpcInterceptionContext &&)

Move-assigns other to this QGrpcInterceptionContext instance. This function is deleted.

### `[delete]` QGrpcInterceptionContext &QGrpcInterceptionContext::operator=(const QGrpcInterceptionContext &)

Copy-assigns other to this QGrpcInterceptionContext instance. This function is deleted.