pub struct MpscConsumer { /* private fields */ }Expand description
MPSC consumer handle for a SharedLayout events region.
Semantics (v1):
- nonblocking receive (
Ok(None)when empty) try_recv_withborrows slot bytes only for the duration of the callback
Implementations§
Source§impl MpscConsumer
impl MpscConsumer
Sourcepub fn try_recv_into(&self, out: &mut [u8]) -> Result<Option<usize>, Error>
pub fn try_recv_into(&self, out: &mut [u8]) -> Result<Option<usize>, Error>
Ok(Some(len))on successOk(None)if queue emptyErr(BufferTooSmall)ifoutis too small
Sourcepub fn try_recv_with<F, R, E>(
&self,
f: F,
) -> Result<Option<R>, RecvWithError<E>>
pub fn try_recv_with<F, R, E>( &self, f: F, ) -> Result<Option<R>, RecvWithError<E>>
Receive by borrowing the slot bytes for the duration of f.
If the callback returns Err, the message is still considered consumed; it will not be
re-delivered.
Sourcepub fn try_recv_slot(&self) -> Result<Option<EventsSlot>, Error>
pub fn try_recv_slot(&self) -> Result<Option<EventsSlot>, Error>
Receive a message as an owned slot handle.
The returned slot is valid until it is dropped (which frees it back to the pool) or
forwarded via publish_slot.
Trait Implementations§
impl Send for MpscConsumer
Auto Trait Implementations§
impl Freeze for MpscConsumer
impl !RefUnwindSafe for MpscConsumer
impl !Sync for MpscConsumer
impl Unpin for MpscConsumer
impl !UnwindSafe for MpscConsumer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more