Remove pub declarations and move to posix::*

This is in order to prepare also for SysV message queues.
This commit is contained in:
finga 2021-06-30 22:46:33 +02:00
parent 606b4de524
commit c2ad74ff15
7 changed files with 24 additions and 18 deletions

24
src/posix/info.rs Normal file
View file

@ -0,0 +1,24 @@
use anyhow::Result;
use clap::Clap;
use posixmq::PosixMq;
/// Print information about an existing message queue
#[derive(Clap, Debug)]
pub struct Info {
/// Name of the queue
#[clap(value_name = "QUEUE")]
pub queue: String,
}
impl Info {
pub fn run(&self) -> Result<()> {
let attrs = PosixMq::open(&self.queue)?.attributes()?;
println!(
"Message queue: {}, msg_max: {}, msgsize_max: {}, current_messages: {}",
&self.queue, &attrs.capacity, &attrs.max_msg_len, &attrs.current_messages
);
Ok(())
}
}