QGrpcCallOptions Class

The QGrpcCallOptions is an storage class used by set additional call options. More...

Header: #include <QGrpcCallOptions>

Public Functions

QGrpcCallOptions()
QGrpcCallOptions(const QGrpcCallOptions &other)
~QGrpcCallOptions()
int deadline() const
int maxRetryAttempts() const
int metadata() const
QGrpcCallOptions &withMaxRetryAttempts(qint64 maxRetryAttempts)
QGrpcCallOptions &withMetadata(const int &metadata)
QGrpcCallOptions &operator=(const QGrpcCallOptions &other)

Detailed Description

\inmoduleQtGrpc

QGrpcCallOptions provides a set of functions to access the call options that are used by gRPC channels to communicate with the services.

Member Function Documentation

QGrpcCallOptions::QGrpcCallOptions()

Constructs an empty QGrpcCallOptions object.

QGrpcCallOptions::QGrpcCallOptions(const QGrpcCallOptions &other)

Construct a copy of QGrpcCallOptions with other object.

[noexcept] QGrpcCallOptions::~QGrpcCallOptions()

Destroys the QGrpcCallOptions object.

int QGrpcCallOptions::deadline() const

Returns deadline value for a call.

Deadline value controls the maximum execution time of an call or a stream. This value overrides value set by QGrpcChannelOptions::deadline() for a specific call or stream.

If value was not set returns empty std::optional.

int QGrpcCallOptions::maxRetryAttempts() const

Returns maximum retry attempts value for a call.

If value was not set returns empty std::optional.

int QGrpcCallOptions::metadata() const

Returns metadata used for a call.

If value was not set returns empty QGrpcMetadata.

QGrpcCallOptions &QGrpcCallOptions::withMaxRetryAttempts(qint64 maxRetryAttempts)

Sets maximum retry attempts value with maxRetryAttempts and returns updated QGrpcCallOptions object.

QGrpcCallOptions &QGrpcCallOptions::withMetadata(const int &metadata)

Sets metadata for a call and returns updated QGrpcCallOptions object.

For HTTP2-based channels, metadata is converted into HTTP/2 headers, that added to the corresponding HTTP/2 request.

QGrpcCallOptions &QGrpcCallOptions::operator=(const QGrpcCallOptions &other)

Assigns other to this QGrpcCallOptions and returns a reference to this QGrpcCallOptions.