sysvmq/README.md
finga 9cc99b8beb
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
readme: Add an example to the readme
2023-12-08 01:50:04 +01:00

422 B

status-badge

Sysvmq

This library provides a convenient and easy usable API for SysV IPC message queues.

use sysvmq::{SysvMq, SysvMqError};

fn example() -> Result<(), SysvMqError> {
    let mut mq = SysvMq::new(0)?;
    let mut buf = [0u8; 11];

    mq.send(b"hello queue")?;
    mq.recv(&mut buf)?;
    mq.delete()?;

    Ok(())
}