[−][src]Struct ipmpsc::Sender
Represents the sending end of an inter-process channel.
Methods
impl Sender
[src]
pub fn from_path(path: &str) -> Result<Sender, Error>
[src]
Creates a new Sender
backed by a file with
the specified name.
The file must already exist and have been initialized by a
call to
Receiver::temp_file
or
Receiver::from_path
.
Any number of senders may be created for a given receiver,
allowing multiple processes to send messages simultaneously to
that receiver.
When creating multiple Sender
s for a
given Receiver
in a single process,
it is much more efficient to use a single from_path
call and
clone
the resulting Sender
than it
is to make multiple calls to from_path
.
pub fn send(&self, value: &impl Serialize) -> Result<(), Error>
[src]
Send the specified message, waiting for sufficient contiguous space to become available in the ring buffer if necessary.
The serialized size of the message must be greater than zero
or else this method will return
Err(Error::from(
error::ZeroSizedMessage
))
.
If the serialized size is greater than the ring buffer
capacity, this method will return
Err(Error::from(
error::MessageTooLarge
))
.
pub fn send_when_empty(&self, value: &impl Serialize) -> Result<(), Error>
[src]
Send the specified message, waiting for the ring buffer to become completely empty first.
This method is appropriate for sending time-sensitive messages where buffering would introduce undesirable latency.
The serialized size of the message must be greater than zero
or else this method will return
Err(Error::from(
error::ZeroSizedMessage
))
.
If the serialized size is greater than the ring buffer
capacity, this method will return
Err(Error::from(
error::MessageTooLarge
))
.
Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for 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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,