Crates.io | posix_mq |
lib.rs | posix_mq |
version | 3771.0.0 |
source | src |
created_at | 2017-10-16 00:31:09.946881 |
updated_at | 2022-02-05 13:29:54.096548 |
description | (Higher-level) Rust bindings to POSIX message queues |
homepage | https://cs.tvl.fyi/depot/-/tree/ops/posix_mq.rs |
repository | https://code.tvl.fyi/depot.git:/ops/posix_mq.rs.git |
max_upload_size | |
id | 35815 |
size | 18,748 |
This is a simple, relatively high-level library for the POSIX message queue API. It wraps the lower-level API in a simpler interface with more robust error handling.
Check out this project's sister library in Kotlin.
Usage example:
// 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");
Development happens in the TVL monorepo.
Starting from version 3771.0.0
, the version numbers correspond to
revisions of the TVL repository, available as git refs (e.g.
refs/r/3771
).
See the TVL documentation for more information about how to contribute to the codebase.