QGrpcChannel Class▲
-
Header: QGrpcChannel
-
Since: Qt 6.5
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS Grpc)
target_link_libraries(mytarget PRIVATE Qt6::Grpc)
-
Inherits: QAbstractGrpcChannel
I. Detailed Description▲
QGrpcChannel accepts the same grpc::ChannelCredentials type that is required by native-api grpc::CreateChannel.
I-1. See Also▲
See also gRPC ChannelCredentials
II. Member Function Documentation▲
II-1. [explicit] QGrpcChannel::QGrpcChannel(const QUrl &url, QGrpcChannel::NativeGrpcChannelCredentials credentialsType, const QStringList &credentialsList)▲
Constructs a gRPC channel, with url, credentialsType, and credentialsList object.
II-2. [explicit] QGrpcChannel::QGrpcChannel(const QUrl &url, QGrpcChannel::NativeGrpcChannelCredentials credentialsType)▲
Constructs a gRPC channel, with url, credentialsType and an empty credentials list.
II-3. [override virtual] QGrpcChannel::~QGrpcChannel()▲
Destroys the QGrpcChannel object.
II-4. [override virtual] QGrpcStatus QGrpcChannel::call(QLatin1StringView method, QLatin1StringView service, QByteArrayView args, QByteArray &ret)▲
Reimplements: QAbstractGrpcChannel::call(QLatin1StringView method, QLatin1StringView service, QByteArrayView args, QByteArray &ret).
Synchronously calls the RPC method and writes the result to the output parameter ret.
The RPC method name is concatenated from the method and service parameters with the given args.
II-5. [override virtual] std::shared_ptr<QGrpcCallReply> QGrpcChannel::call(QAbstractGrpcClient *client, QLatin1StringView method, QLatin1StringView service, QByteArrayView args)▲
Reimplements: QAbstractGrpcChannel::call(QAbstractGrpcClient *client, QLatin1StringView method, QLatin1StringView service, QByteArrayView args).
Asynchronously calls the RPC method.
The RPC method name is concatenated from the method and service parameters with the given args. The method can emit QGrpcCallReply::finished() and QGrpcCallReply::errorOccurred() signals on a QGrpcCallReply returned object.
II-6. [override virtual] std::shared_ptr<QAbstractProtobufSerializer> QGrpcChannel::serializer() const▲
Reimplements: QAbstractGrpcChannel::serializer() const.
Returns the newly created QProtobufSerializer shared pointer.
II-7. [override virtual] void QGrpcChannel::startStream(QGrpcStream *stream, QLatin1StringView service)▲
Reimplements: QAbstractGrpcChannel::startStream(QGrpcStream *stream, QLatin1StringView service).
Starts a stream on a stream using QGrpcStream::method() and the service to get the name of the RPC method.
Calls QGrpcStream::handler() when the stream receives data from the server. The method may emit QGrpcStream::errorOccurred() when the stream has terminated with an error.