pub struct TypedMpscConsumer<C> { /* private fields */ }Expand description
Typed MPSC consumer that decodes v1-framed messages using codec C.
See TypedSpscReceiver for receive-side partial-effect semantics.
Implementations§
Source§impl<C> TypedMpscConsumer<C>
impl<C> TypedMpscConsumer<C>
Source§impl<C> TypedMpscConsumer<C>
impl<C> TypedMpscConsumer<C>
Sourcepub fn try_recv_borrowed_with<T, F, R>(
&self,
meta: MsgMeta,
f: F,
) -> Result<Option<R>, Error>
pub fn try_recv_borrowed_with<T, F, R>( &self, meta: MsgMeta, f: F, ) -> Result<Option<R>, Error>
Receive a typed borrowed view and process it within f.
See TypedSpscReceiver::try_recv_borrowed_with for partial-effect semantics.
Sourcepub fn try_recv_borrowed_msg_with<T, F, R>(
&self,
f: F,
) -> Result<Option<R>, Error>where
T: IndexbusMsgSpec,
C: CodecId + DecodeBorrowed<T>,
F: for<'a> FnMut(Header, <C as DecodeBorrowed<T>>::View<'a>) -> Result<R, Error>,
pub fn try_recv_borrowed_msg_with<T, F, R>(
&self,
f: F,
) -> Result<Option<R>, Error>where
T: IndexbusMsgSpec,
C: CodecId + DecodeBorrowed<T>,
F: for<'a> FnMut(Header, <C as DecodeBorrowed<T>>::View<'a>) -> Result<R, Error>,
Receive a typed borrowed view using compile-time identity (T::META).
Source§impl<C> TypedMpscConsumer<C>
impl<C> TypedMpscConsumer<C>
Sourcepub fn try_recv_owned<T>(
&self,
meta: MsgMeta,
) -> Result<Option<(Header, T)>, Error>where
C: CodecId + DecodeFrom<T>,
pub fn try_recv_owned<T>(
&self,
meta: MsgMeta,
) -> Result<Option<(Header, T)>, Error>where
C: CodecId + DecodeFrom<T>,
Receive and decode a typed owned value.
Returns Ok(None) when the queue is empty. On success returns the decoded v1 header and
decoded value.
See TypedSpscReceiver::try_recv_owned for partial-effect semantics.
Sourcepub fn try_recv_owned_msg<T>(&self) -> Result<Option<(Header, T)>, Error>where
T: IndexbusMsgSpec,
C: CodecId + DecodeFrom<T>,
pub fn try_recv_owned_msg<T>(&self) -> Result<Option<(Header, T)>, Error>where
T: IndexbusMsgSpec,
C: CodecId + DecodeFrom<T>,
Receive a typed owned value using compile-time identity (T::META).
Auto Trait Implementations§
impl<C> Freeze for TypedMpscConsumer<C>where
C: Freeze,
impl<C> !RefUnwindSafe for TypedMpscConsumer<C>
impl<C> Send for TypedMpscConsumer<C>where
C: Send,
impl<C> !Sync for TypedMpscConsumer<C>
impl<C> Unpin for TypedMpscConsumer<C>where
C: Unpin,
impl<C> !UnwindSafe for TypedMpscConsumer<C>
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