6 个版本 (1 个稳定版)
使用旧的 Rust 2015
3771.0.0 | 2022 年 2 月 5 日 |
---|---|
0.9.0 | 2020 年 1 月 20 日 |
0.1.3 | 2018 年 5 月 3 日 |
0.1.2 | 2017 年 10 月 20 日 |
#646 in Unix API
在 mq_cli 中使用
17KB
259 行代码,不包括注释
posix_mq
这是一个针对 POSIX 消息队列 API 的简单、相对高级的库。它使用更健壮的错误处理将底层 API 封装在更简单的接口中。
查看这个项目的 Kotlin 姐妹库。
使用示例
// Values that need to undergo validation are wrapped in safe types:
let name = Name::new("/test-queue").unwrap();
// Queue creation with system defaults is simple:
let queue = Queue::open_or_create(name).expect("Opening queue failed");
// Sending a message:
let message = Message {
data: "test-message".as_bytes().to_vec(),
priority: 0,
};
queue.send(&message).expect("message sending failed");
// ... and receiving it!
let result = queue.receive().expect("message receiving failed");
开发
开发发生在 TVL 单一代码库。
从版本 3771.0.0
开始,版本号对应于 TVL 仓库的 修订版,作为 git 引用(例如 refs/r/3771
)。
有关如何为代码库做出贡献的更多信息,请参阅 TVL 文档。
依赖项
~1.5MB
~36K SLoC