QGrpcChannelOptions Class

The QGrpcChannelOptions is an storage class used to set additional channel options. More...

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

Public Functions

QGrpcChannelOptions(const QUrl &host)
QGrpcChannelOptions(const QGrpcChannelOptions &other)
~QGrpcChannelOptions()
std::optional<std::chrono::milliseconds> deadline() const
QUrl host() const
QGrpcMetadata metadata() const
std::optional<QSslConfiguration> sslConfiguration() const
QGrpcChannelOptions &withDeadline(std::chrono::milliseconds deadline)
QGrpcChannelOptions &withHost(const QUrl &host)
QGrpcChannelOptions &withMetadata(const QGrpcMetadata &metadata)
QGrpcChannelOptions &withSslConfiguration(const QSslConfiguration &sslConfiguration)
QGrpcChannelOptions &operator=(const QGrpcChannelOptions &other)

Detailed Description

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

Member Function Documentation

[explicit] QGrpcChannelOptions::QGrpcChannelOptions(const QUrl &host)

Constructs an QGrpcChannelOptions object with host value.

QGrpcChannelOptions::QGrpcChannelOptions(const QGrpcChannelOptions &other)

Construct a copy of QGrpcChannelOptions with other object.

[noexcept] QGrpcChannelOptions::~QGrpcChannelOptions()

Destroys the QGrpcChannelOptions object.

std::optional<std::chrono::milliseconds> QGrpcChannelOptions::deadline() const

Returns deadline value for setting up the channel.

Deadline value controls the maximum execution time of any call or stream executed on the channel.

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

QUrl QGrpcChannelOptions::host() const

Returns host value for the channel.

QGrpcMetadata QGrpcChannelOptions::metadata() const

Returns metadata used for every call on the channel.

If value was not set returns empty QGrpcMetadata.

std::optional<QSslConfiguration> QGrpcChannelOptions::sslConfiguration() const

Returns SSL configuration for the channel.

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

QGrpcChannelOptions &QGrpcChannelOptions::withDeadline(std::chrono::milliseconds deadline)

Sets deadline value with deadline and returns updated QGrpcChannelOptions object.

QGrpcChannelOptions &QGrpcChannelOptions::withHost(const QUrl &host)

Sets host value with host and returns updated QGrpcChannelOptions object.

QGrpcChannelOptions &QGrpcChannelOptions::withMetadata(const QGrpcMetadata &metadata)

Sets metadata for all calls and returns updated QGrpcChannelOptions object.

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

QGrpcChannelOptions &QGrpcChannelOptions::withSslConfiguration(const QSslConfiguration &sslConfiguration)

Sets SSL configuration with sslConfiguration and returns updated QGrpcChannelOptions object.

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

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

© 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.