[][src]Struct ipmpsc::ZeroCopyContext

pub struct ZeroCopyContext<'a> { /* fields omitted */ }

Borrows a Receiver for the purpose of doing zero-copy deserialization of messages containing references.

An instance of this type may only be used to deserialize a single message before it is dropped because the Drop implementation is what advances the ring buffer pointer. Also, the borrowed Receiver may not be used directly while it is borrowed by a ZeroCopyContext.

Use Receiver::zero_copy_context to create an instance.

Methods

impl<'a> ZeroCopyContext<'a>[src]

pub fn try_recv<'b, T: Deserialize<'b>>(
    &'b mut self
) -> Result<Option<T>, Error>
[src]

Attempt to read a message without blocking.

This will return Ok(None) if there are no messages immediately available. It will return Err(Error::from(error::AlreadyReceived)) if this instance has already been used to read a message.

pub fn recv<'b, T: Deserialize<'b>>(&'b mut self) -> Result<T, Error>[src]

Attempt to read a message, blocking if necessary until one becomes available.

This will return Err(Error::from(error::AlreadyReceived)) if this instance has already been used to read a message.

pub fn recv_timeout<'b, T: Deserialize<'b>>(
    &'b mut self,
    timeout: Duration
) -> Result<Option<T>, Error>
[src]

Attempt to read a message, blocking for up to the specified duration if necessary until one becomes available.

This will return Err(Error::from(error::AlreadyReceived)) if this instance has already been used to read a message.

Trait Implementations

impl<'a> Drop for ZeroCopyContext<'a>[src]

Auto Trait Implementations

impl<'a> Sync for ZeroCopyContext<'a>

impl<'a> Send for ZeroCopyContext<'a>

impl<'a> Unpin for ZeroCopyContext<'a>

impl<'a> !RefUnwindSafe for ZeroCopyContext<'a>

impl<'a> !UnwindSafe for ZeroCopyContext<'a>

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<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]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,