描述符模块函数(实验性)
bookmark_borderbookmark
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
protorpc.remote
软件包提供以下函数:
- is_error_status(status)
-
确定 RPC 状态是否出错。
参数
- 状态
- 将要进行错误状态检查的初始化 RpcStatus 消息。
- check_rpc_status(status)
-
将错误状态转换为一个引发的异常。
参数
- 状态
- 将要进行错误状态检查的初始化 RpcStatus 消息。
如果 status
的状态为错误,则会引发RpcError。
- method(request_type=message_types.VoidMessage, response_type=message_types.VoidMessage)
-
修饰某个方法使其成为远程方法。
参数
- request_type=message_types.VoidMessage
- 预期请求的消息类型。
- response_type=message_types.VoidMessage
- 预期响应的消息类型。
返回修饰后的远程方法。该远程方法包含具有以下属性的 remote
属性:
- 方法
- 原始的、未修饰的方法
- request_type
- 预期请求的消息类型。
- response_type
- 预期响应的消息类型。
如果 request_type
或 response_type
参数不是适当的消息子类,则会引发TypeError。
- get_remote_method(method)
-
对于远程方法,会返回远程方法信息对象,否则返回 None。
参数
- 方法
- 要获取的方法。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-05-13。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-05-13。"],[[["`is_error_status(status)` checks if an `RpcStatus` message indicates an error."],["`check_rpc_status(status)` raises an `RpcError` exception if the provided `RpcStatus` message indicates an error."],["`method()` decorates a method to make it remote, defining its request and response message types."],["`get_remote_method(method)` retrieves remote method information for a given method or returns `None` if it's not a remote method."]]],[]]