QGrpcChannelOperation Class

The QGrpcChannelOperation class implements common logic to handle the gRPC communication from the channel side. 更多...

头: #include <QGrpcChannelOperation>
CMake: find_package(Qt6 REQUIRED COMPONENTS Grpc)
target_link_libraries(mytarget PRIVATE Qt6::Grpc)
Since: Qt 6.7
继承: QObject
状态: 技术预览

公共函数

QByteArrayView argument () const
QLatin1StringView 方法 () const
const QGrpcCallOptions & options () const
std::shared_ptr<const QAbstractProtobufSerializer> serializer () const
const QGrpcMetadata & serverMetadata () const
QLatin1StringView service () const
void setArgument (QByteArrayView arg )
void setClientMetadata (const QGrpcMetadata & metadata )
void setClientMetadata (QGrpcMetadata && metadata )
void setOptions (QGrpcCallOptions & options )
void setServerMetadata (const QGrpcMetadata & metadata )
void setServerMetadata (QGrpcMetadata && metadata )

信号

void dataReady (const QByteArray & data )
void sendData (const QByteArray & data ) const

详细描述

成员函数文档编制

[noexcept] QByteArrayView QGrpcChannelOperation:: argument () const

Returns the serialized arguments that are used for this operation.

另请参阅 setArgument ().

[signal] void QGrpcChannelOperation:: dataReady (const QByteArray & data )

The signal should be emitted by the channel when the new chunk of data is received.

For client streams and unary calls, this means that the response is received from the server, and communication will be successfully finished. For server and bidir streams this signal should be called by channel to signalize that receiving of new message is completed and user business logic now can process it at the client side.

The signal is implicitly connected to the QGrpcOperation counterpart.

[noexcept] QLatin1StringView QGrpcChannelOperation:: 方法 () const

Returns the method name that is assigned to this operation.

[noexcept] const QGrpcCallOptions &QGrpcChannelOperation:: options () const

Return the options that are assigned to this operation.

另请参阅 setOptions ().

[signal] void QGrpcChannelOperation:: sendData (const QByteArray & data ) const

The signal is emitted when the client tries to send a new message to the channel.

This signal can only be emitted by client or bidir streams. Implementations of QAbstractGrpcChannel should connect the sending logic to this signal. The data should be wrapped with the channel-related headers and sent to the wire.

The signal is implicitly connected to the QGrpcOperation counterpart.

[noexcept] std::shared_ptr <const QAbstractProtobufSerializer > QGrpcChannelOperation:: serializer () const

Return the serializer that is assigned to this operation.

[noexcept] const QGrpcMetadata &QGrpcChannelOperation:: serverMetadata () const

Returns the metadata that is received from server.

The method is used implicitly by QGrpcOperation counterpart.

另请参阅 setServerMetadata ().

[noexcept] QLatin1StringView QGrpcChannelOperation:: service () const

Returns the service name that is assigned to this operation.

void QGrpcChannelOperation:: setArgument ( QByteArrayView arg )

Updates the arg attribute that will be used for this operation.

The method expects arg to be serialized data.

另请参阅 argument ().

void QGrpcChannelOperation:: setClientMetadata (const QGrpcMetadata & metadata )

Updates client metadata in the QGrpcCallOptions 属性。

The metadata then can be processed on the server side.

void QGrpcChannelOperation:: setClientMetadata ( QGrpcMetadata && metadata )

Updates client metadata in the QGrpcCallOptions 属性。

The metadata then can be processed on the server side.

void QGrpcChannelOperation:: setOptions ( QGrpcCallOptions & options )

Updates the call options 属性。

另请参阅 options ().

void QGrpcChannelOperation:: setServerMetadata (const QGrpcMetadata & metadata )

Stores the recently received server metadata.

The metadata then can be processed on the client side.

另请参阅 serverMetadata ().

void QGrpcChannelOperation:: setServerMetadata ( QGrpcMetadata && metadata )

Stores the recently received server metadata.

The metadata then can be processed on the client side.