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.
Updates the arg attribute that will be used for this operation.
The method expects arg to be serialized data.
另请参阅 argument ().
Updates client metadata in the QGrpcCallOptions 属性。
The metadata then can be processed on the server side.
Updates client metadata in the QGrpcCallOptions 属性。
The metadata then can be processed on the server side.
Updates the call options 属性。
另请参阅 options ().
Stores the recently received server metadata.
The metadata then can be processed on the client side.
另请参阅 serverMetadata ().
Stores the recently received server metadata.
The metadata then can be processed on the client side.