Struct posixmq::OpenOptions [−][src]
Flags and parameters which control how a PosixMq
message queue is opened or created.
Implementations
impl OpenOptions
[src]
pub fn readonly() -> Self
[src]
Open message queue for receiving only.
pub fn writeonly() -> Self
[src]
Open message queue for sending only.
pub fn readwrite() -> Self
[src]
Open message queue both for sending and receiving.
pub fn mode(&mut self, mode: u32) -> &mut Self
[src]
Set permissions to create the queue with.
Some bits might be cleared by the process's umask when creating the queue, and unknown bits are ignored.
This field is ignored if the queue already exists or should not be created. If this method is not called, queues are created with mode 600.
pub fn max_msg_len(&mut self, max_msg_len: usize) -> &mut Self
[src]
Set the maximum size of each message.
recv()
will fail if given a buffer smaller than this value.
If max_msg_len and capacity are both zero (or not set), the queue
will be created with a maximum length and capacity decided by the
operating system.
If this value is specified, capacity should also be, or opening the
message queue might fail.
pub fn capacity(&mut self, capacity: usize) -> &mut Self
[src]
Set the maximum number of messages in the queue.
When the queue is full, further send()
s will either block
or fail with an error of type ErrorKind::WouldBlock
.
If both capacity and max_msg_len are zero (or not set), the queue
will be created with a maximum length and capacity decided by the
operating system.
If this value is specified, max_msg_len should also be, or opening the
message queue might fail.
pub fn create(&mut self) -> &mut Self
[src]
Create message queue if it doesn't exist.
pub fn create_new(&mut self) -> &mut Self
[src]
Create a new queue, failing if the queue already exists.
pub fn existing(&mut self) -> &mut Self
[src]
Require the queue to already exist, failing if it doesn't.
pub fn nonblocking(&mut self) -> &mut Self
[src]
Open the message queue in non-blocking mode.
This must be done if you want to use the message queue with mio.
pub fn open<N: AsRef<[u8]> + ?Sized>(&self, name: &N) -> Result<PosixMq, Error>
[src]
Open a queue with the specified options.
If the name doesn't start with a '/', one will be prepended.
Errors
- Queue doesn't exist (ENOENT) =>
ErrorKind::NotFound
- Name is just "/" (ENOENT) or is empty =>
ErrorKind::NotFound
- Queue already exists (EEXISTS) =>
ErrorKind::AlreadyExists
- Not permitted to open in this mode (EACCESS) =>
ErrorKind::PermissionDenied
- More than one '/' in name (EACCESS) =>
ErrorKind::PermissionDenied
- Invalid capacities (EINVAL) =>
ErrorKind::InvalidInput
- Capacities too high (EMFILE) =>
ErrorKind::Other
- Posix message queues are disabled (ENOSYS) =>
ErrorKind::Other
- Name contains '\0' =>
ErrorKind::InvalidInput
- Name is too long (ENAMETOOLONG) =>
ErrorKind::Other
- Unlikely (ENFILE, EMFILE, ENOMEM, ENOSPC) =>
ErrorKind::Other
- Possibly other
pub fn open_c(&self, name: &CStr) -> Result<PosixMq, Error>
[src]
Open a queue with the specified options and without inspecting name
or allocating.
This can on NetBSD be used to access message queues with names that doesn't start with a '/'.
Errors
- Queue doesn't exist (ENOENT) =>
ErrorKind::NotFound
- Name is just "/" (ENOENT) =>
ErrorKind::NotFound
- Queue already exists (EEXISTS) =>
ErrorKind::AlreadyExists
- Not permitted to open in this mode (EACCESS) =>
ErrorKind::PermissionDenied
- More than one '/' in name (EACCESS) =>
ErrorKind::PermissionDenied
- Invalid capacities (EINVAL) =>
ErrorKind::InvalidInput
- Posix message queues are disabled (ENOSYS) =>
ErrorKind::Other
- Name is empty (EINVAL) =>
ErrorKind::InvalidInput
- Name is too long (ENAMETOOLONG) =>
ErrorKind::Other
- Unlikely (ENFILE, EMFILE, ENOMEM, ENOSPC) =>
ErrorKind::Other
- Possibly other
Trait Implementations
impl Clone for OpenOptions
[src]
fn clone(&self) -> OpenOptions
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for OpenOptions
[src]
impl Debug for OpenOptions
[src]
impl Eq for OpenOptions
[src]
impl PartialEq<OpenOptions> for OpenOptions
[src]
fn eq(&self, other: &OpenOptions) -> bool
[src]
fn ne(&self, other: &OpenOptions) -> bool
[src]
impl StructuralEq for OpenOptions
[src]
impl StructuralPartialEq for OpenOptions
[src]
Auto Trait Implementations
impl RefUnwindSafe for OpenOptions
[src]
impl Send for OpenOptions
[src]
impl Sync for OpenOptions
[src]
impl Unpin for OpenOptions
[src]
impl UnwindSafe for OpenOptions
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,