QGrpcCallOptions Class

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

Header: #include <QGrpcCallOptions>
CMake: find_package(Qt6 REQUIRED COMPONENTS Grpc)
target_link_libraries(mytarget PRIVATE Qt6::Grpc)
Since: Qt 6.6
Instantiated By: QQmlGrpcCallOptions
Status: Technical Preview

Public Functions

QGrpcCallOptions()
QGrpcCallOptions(const QGrpcCallOptions &other)
~QGrpcCallOptions()
std::optional<QGrpcDuration> deadline() const
QGrpcMetadata metadata() &&
const QGrpcMetadata &metadata() const &
QGrpcCallOptions &withDeadline(QGrpcDuration deadline)
QGrpcCallOptions &withMetadata(QGrpcMetadata &&metadata)
QGrpcCallOptions &withMetadata(const QGrpcMetadata &metadata)
QGrpcCallOptions &operator=(const QGrpcCallOptions &other)
(since 6.8) QDebug operator<<(QDebug debug, const QGrpcCallOptions &callOpts)

Detailed Description

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

[noexcept] QGrpcMetadata QGrpcCallOptions::metadata() &&

[noexcept] const QGrpcMetadata &QGrpcCallOptions::metadata() const &

Returns metadata used for a call.

If value was not set returns empty QGrpcMetadata.

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.

[noexcept] std::optional<QGrpcDuration> 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.

QGrpcCallOptions &QGrpcCallOptions::withDeadline(QGrpcDuration deadline)

Sets deadline value with deadline and returns updated QGrpcCallOptions object.

[noexcept] QGrpcCallOptions &QGrpcCallOptions::withMetadata(QGrpcMetadata &&metadata)

Sets metadata for a call and returns updated QGrpcCallOptions object.

See also withMetadata().

QGrpcCallOptions &QGrpcCallOptions::withMetadata(const QGrpcMetadata &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.

Related Non-Members

[since 6.8] QDebug operator<<(QDebug debug, const QGrpcCallOptions &callOpts)

Writes callOpts to the specified stream debug.

This function was introduced in Qt 6.8.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.