Qt GRPC 拦截器
有关拦截机制的介绍以及拦截器接口如何参与 RPC 生命周期的说明,请参阅Qt GRPC 《拦截器概述》。
Qt GRPC 在 RPC 生命周期中,xml-ph-0000@deepl.internal 提供了以下拦截器接口作为钩子点:
| 接口 | 挂钩点 | 方向 | 可修改 |
|---|---|---|---|
| QGrpcStartInterceptor | RPC 发起之前 | 出站 | 初始消息对象、调用选项 |
| QGrpcWriteMessageInterceptor | 在写入出站消息之前 | 出站 | 消息对象 |
| QGrpcWritesDoneInterceptor | 当客户端指示写入操作完成时 | 出站 | — |
| QGrpcCancelInterceptor | 当 RPC 被取消时 | 出站 | — |
| QGrpcInitialMetadataInterceptor | 收到初始元数据时 | 入站 | 元数据 |
| QGrpcMessageReceivedInterceptor | 收到消息负载时 | 入站 | 序列化后的消息数据 |
| QGrpcTrailingMetadataInterceptor | 当接收到尾部元数据时 | 入站 | 元数据 |
| QGrpcFinishedInterceptor | 当 RPC 完成时 | 入站 | 最终状态 |
以下类和页面构成了Qt GRPC 拦截器机制:
拦截针对 RPC 的取消请求 | |
拦截 RPC 的完成状态 | |
拦截 RPC 的初始元数据 | |
向拦截器回调提供上下文信息 | |
存储并管理一组拦截器 | |
拦截 RPC 的传入消息负载 | |
拦截 RPC 的开始 | |
拦截 RPC 的尾部元数据 | |
拦截为 RPC 编写的出站消息 | |
拦截 RPC 消息写入的完成 | |
概述了Qt GRPC 拦截器机制。 | |
控制被拦截的 RPC 是否应继续执行 | |
指定拦截器支持的拦截挂钩点 |
© 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.