pub struct FanoutConsumer<const N: usize> { /* private fields */ }Expand description
Consumer handle for a fanout events region.
Consumers only receive messages after they have been routed into their consumer queue. Without a running router, consumers will not observe new messages.
Implementations§
Source§impl<const N: usize> FanoutConsumer<N>
impl<const N: usize> FanoutConsumer<N>
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>
Attempt to receive the next message into out.
Returns:
Ok(Some(n))when a message of lengthnwas copied intooutOk(None)when empty (or ifconsumeris out of range)Err(Error::BufferTooSmall)whenoutcannot hold the message
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.
The borrowed &[u8] is only valid for the duration of the callback.
If the callback returns Err, the message is still considered consumed; it will not be
re-delivered.
Trait Implementations§
impl<const N: usize> Send for FanoutConsumer<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for FanoutConsumer<N>
impl<const N: usize> !RefUnwindSafe for FanoutConsumer<N>
impl<const N: usize> !Sync for FanoutConsumer<N>
impl<const N: usize> Unpin for FanoutConsumer<N>
impl<const N: usize> !UnwindSafe for FanoutConsumer<N>
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