91ef2b671e
The previous version had a CVE. As part of this upgrade, the handling of errors inside of the Nix crate changed, which we now accommodate. Change-Id: Iad9a473c1782e0d79919cb5dc3f76316852d8a16 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5226 Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org> |
||
---|---|---|
.. | ||
src | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
CODE_OF_CONDUCT.md | ||
default.nix | ||
LICENSE | ||
README.md |
posix_mq
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");