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]
impl<'a> ZeroCopyContext<'a>
[src]pub fn try_recv<'b, T: Deserialize<'b>>(&'b mut self) -> Result<Option<T>>
[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]
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]
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
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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,