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
In QML: QQmlGrpcChannelOptions
Status: Technical Preview

Public Functions

QGrpcChannelOptions()
QGrpcChannelOptions(const QGrpcChannelOptions &other)
QGrpcChannelOptions(QGrpcChannelOptions &&other)
~QGrpcChannelOptions()
std::optional<QGrpcDuration> deadline() const
QGrpcMetadata metadata() &&
const QGrpcMetadata &metadata() const &
(since 6.8) QGrpcSerializationFormat serializationFormat() &&
(since 6.8) const QGrpcSerializationFormat &serializationFormat() const &
QGrpcChannelOptions &setDeadline(QGrpcDuration deadline)
QGrpcChannelOptions &setMetadata(QGrpcMetadata &&metadata)
QGrpcChannelOptions &setMetadata(const QGrpcMetadata &metadata)
(since 6.8) QGrpcChannelOptions &setSerializationFormat(const QGrpcSerializationFormat &format)
std::optional<QSslConfiguration> sslConfiguration() const
QGrpcChannelOptions &withSslConfiguration(const QSslConfiguration &sslConfiguration)
QGrpcChannelOptions &operator=(QGrpcChannelOptions &&other)
QGrpcChannelOptions &operator=(const QGrpcChannelOptions &other)
(since 6.8) QDebug operator<<(QDebug debug, const QGrpcChannelOptions &chOpts)

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

QGrpcChannelOptions &QGrpcChannelOptions::setMetadata(QGrpcMetadata &&metadata)

QGrpcChannelOptions &QGrpcChannelOptions::setMetadata(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.

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

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

Returns metadata used for every call on the channel.

If value was not set returns empty QGrpcMetadata.

[noexcept, since 6.8] QGrpcSerializationFormat QGrpcChannelOptions::serializationFormat() &&

[noexcept, since 6.8] const QGrpcSerializationFormat &QGrpcChannelOptions::serializationFormat() const &

Returns the serialization format used in QAbstractGrpcChannel implementations.

This function was introduced in Qt 6.8.

QGrpcChannelOptions::QGrpcChannelOptions()

Constructs a QGrpcChannelOptions.

QGrpcChannelOptions::QGrpcChannelOptions(const QGrpcChannelOptions &other)

Construct a copy of QGrpcChannelOptions with other object.

[noexcept] QGrpcChannelOptions::QGrpcChannelOptions(QGrpcChannelOptions &&other)

Move-construct a QGrpcChannelOptions instance, making it point at the same object that other was pointing to.

[noexcept] QGrpcChannelOptions::~QGrpcChannelOptions()

Destroys the QGrpcChannelOptions object.

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

See also setDeadline().

QGrpcChannelOptions &QGrpcChannelOptions::setDeadline(QGrpcDuration deadline)

Sets deadline value with deadline and returns updated QGrpcChannelOptions object.

See also deadline().

[since 6.8] QGrpcChannelOptions &QGrpcChannelOptions::setSerializationFormat(const QGrpcSerializationFormat &format)

Sets the serialization format in the channel and returns updated QGrpcChannelOptions object.

The serialization format should be considered in QAbstractGrpcChannel implementations.

This function was introduced in Qt 6.8.

See also serializationFormat().

[noexcept] std::optional<QSslConfiguration> QGrpcChannelOptions::sslConfiguration() const

Returns SSL configuration for the channel.

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

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

Sets SSL configuration with sslConfiguration and returns updated QGrpcChannelOptions object.

[noexcept] QGrpcChannelOptions &QGrpcChannelOptions::operator=(QGrpcChannelOptions &&other)

Move-assigns other to this QGrpcChannelOptions instance.

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

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

Related Non-Members

[since 6.8] QDebug operator<<(QDebug debug, const QGrpcChannelOptions &chOpts)

Writes chOpts to the specified stream debug.

This function was introduced in Qt 6.8.