[][src]Struct ipmpsc::Sender

pub struct Sender { /* fields omitted */ }

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 Senders 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

impl Sync for Sender[src]

impl Send for Sender[src]

impl Clone for Sender[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]