本页内容

QGrpcFinishedInterceptor Class

拦截 RPC 的完成状态。更多内容...

头文件: #include <QGrpcInterceptor>
CMake: find_package(Qt6 REQUIRED COMPONENTS Grpc)
target_link_libraries(mytarget PRIVATE Qt6::Grpc)
自: Qt 6.11

注意:该类中的所有函数均为可重入的。

公共函数

virtual ~QGrpcFinishedInterceptor()
virtual void onFinished(QGrpcInterceptionContext &context, QGrpcStatus &status) = 0

详细说明

实现 QGrpcFinishedInterceptor 以监视或修改 RPC 的最终状态。

有关拦截机制的介绍以及拦截器接口如何参与 RPC 生命周期的信息,请参阅《Qt GRPC 拦截器概述》。

注意:此 拦截器在出站方向上运行。有关多个拦截器回调如何在链中流转的详细信息,请参阅“方向和流”部分。

另请参阅 QtGrpc::InterceptorCapability::Finished 、QGrpcOperation::finished() 以及QGrpcInterceptionContext 。

成员函数文档

[virtual noexcept] QGrpcFinishedInterceptor::~QGrpcFinishedInterceptor()

摧毁了这架拦截机。

[pure virtual] void QGrpcFinishedInterceptor::onFinished(QGrpcInterceptionContext &context, QGrpcStatus &status)

在 RPC 完成时调用。

context 提供有关被拦截的 RPC 的信息。status 包含最终状态,且可以就地修改。

另请参阅 QGrpcOperation::finished()。

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