Struct Queue

Source
pub struct Queue { /* private fields */ }
Expand description

Represents an open queue descriptor to a POSIX message queue. This carries information about the queue’s limitations (i.e. maximum message size and maximum message count).

Implementations§

Source§

impl Queue

Source

pub fn create( name: Name, max_pending: i64, max_size: i64, ) -> Result<Queue, Error>

Creates a new queue and fails if it already exists. By default the queue will be read/writable by the current user with no access for other users. Linux users can change this setting themselves by modifying the queue file in /dev/mqueue.

Source

pub fn open(name: Name) -> Result<Queue, Error>

Opens an existing queue.

Source

pub fn open_or_create(name: Name) -> Result<Queue, Error>

Opens an existing queue or creates a new queue with the OS default settings.

Source

pub fn delete(self) -> Result<(), Error>

Delete a message queue from the system. This method will make the queue unavailable for other processes after their current queue descriptors have been closed.

Source

pub fn send(&self, msg: &Message) -> Result<(), Error>

Send a message to the message queue. If the queue is full this call will block until a message has been consumed.

Source

pub fn receive(&self) -> Result<Message, Error>

Receive a message from the message queue. If the queue is empty this call will block until a message arrives.

Source

pub fn max_pending(&self) -> i64

Source

pub fn max_size(&self) -> usize

Trait Implementations§

Source§

impl Debug for Queue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Queue

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Queue

§

impl RefUnwindSafe for Queue

§

impl Send for Queue

§

impl Sync for Queue

§

impl Unpin for Queue

§

impl UnwindSafe for Queue

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.