Struct ipmpsc::ZeroCopyContext[][src]

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

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.

Implementations

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

pub fn try_recv<'b, T: Deserialize<'b>>(&'b mut self) -> Result<Option<T>>[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::AlreadyReceived)) if this instance has already been used to read a message.

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

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

This will return Err(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>>
[src]

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

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

Trait Implementations

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

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

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

Performs the conversion.

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.

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

Performs the conversion.

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

pub fn vzip(self) -> V