英文版本为准
本页译自英文,由模型翻译。若与英文原文存在差异,以英文原文为准。
保证
无法通过编译的错误,以及编译器对每一种错误给出的提示。
以文字阅读本图
- 应答类型 没有 #[derive(Outgoing)] → `Receipt` does not declare where it is published
- 在已声明地址的 应答上使用 命名变换 → `Receipt` does not let a transform name the destination
- 没有启用 任何编解码器 特性的挂载 → no codec is available to decode this subscriber's input
- Out<impl RequestReply> 用在不具备该 能力的发布者上 → `MemoryPublisher` does not support request / reply messaging
- 同一个订阅者上 同时写 workers(4) 和 threads(2) → workers(..) and threads(..) fill the same position: name one of them
- 没有目的地 的发布 → this publish has no destination yet
- 缺少消息所声明 的消息头的发布 → the headers of this publish do not match the message's contract
- 你写的
- 编译器的回答
编译器能看出的错误,RustStream 就让它成为编译错误,而不是启动时或每条消息上的检查。每条消息上的检查会让每次投递都付出代价,启动时的检查则只有在服务第一次运行的地方才能发现错误。每条提示都会指出出错的类型或步骤。
图中各行依次对应应答、变换、编解码器、发布者能力、分发、发布和类型化消息头的规则。挂载链上已经设定过的设置不能再设定一次;Broker 不具备的能力,表现为缺少方法或约束不满足。
生命周期同样是类型化的:未连接的 Broker 没有用来订阅或发布的方法,已关闭的 Broker 已经被消耗掉了。