tvl-depot/ops/posix_mq.rs
Vincent Ambo 054fe8f94b refactor(ops/posix_mq.rs): Update code using deprecated Error trait
The previous Error::description method was deprecated.

Change-Id: I63efd272484c8715b9f324ab09e967fbf53cf55a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5224
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2022-02-04 12:47:55 +00:00
..
src refactor(ops/posix_mq.rs): Update code using deprecated Error trait 2022-02-04 12:47:55 +00:00
.gitignore feat(ops/posix_mq.rs): Set up Nix build 2020-01-20 11:59:21 +00:00
Cargo.lock feat(ops/posix_mq.rs): Set up Nix build 2020-01-20 11:59:21 +00:00
Cargo.toml chore(ops/posix_mq.rs): Update crate dependencies to recent versions 2020-01-20 11:51:24 +00:00
CODE_OF_CONDUCT.md Add 'ops/posix_mq.rs/' from commit 'f7d1a38da67e92e0e87dbb988d288f0be2714f5c' 2020-01-20 11:32:02 +00:00
default.nix chore: Rename pkgs->depot in all Nix file headers 2020-02-21 13:54:53 +00:00
LICENSE chore(ops/posix_mq.rs): Update crate dependencies to recent versions 2020-01-20 11:51:24 +00:00
README.md Add 'ops/posix_mq.rs/' from commit 'f7d1a38da67e92e0e87dbb988d288f0be2714f5c' 2020-01-20 11:32:02 +00:00

posix_mq

Build Status crates.io

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");