[−][src]Struct ipmpsc::ZeroCopyContext
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]
&'b mut self
) -> Result<Option<T>, Error>
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]
&'b mut self,
timeout: Duration
) -> Result<Option<T>, Error>
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]
U: From<T>,
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,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,