pub struct Receiver<T>(/* private fields */);Expand description
A Relm4 receiver receives messages from a component or worker.
Implementations§
Source§impl<T> Receiver<T>
impl<T> Receiver<T>
Sourcepub async fn recv(&self) -> Option<T>
pub async fn recv(&self) -> Option<T>
Receives a message from a component or worker.
Returns None if all senders have been disconnected.
Sourcepub fn recv_sync(&self) -> Option<T>
pub fn recv_sync(&self) -> Option<T>
Receives a message synchronously from a component or worker.
Returns None if all senders have been disconnected.
Sourcepub fn into_stream(self) -> RecvStream<'static, T>
pub fn into_stream(self) -> RecvStream<'static, T>
Convert this receiver into a stream that asynchronously yields messages from the channel.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Receiver<T>
impl<T> RefUnwindSafe for Receiver<T>
impl<T> Send for Receiver<T>where
T: Send,
impl<T> Sync for Receiver<T>where
T: Send,
impl<T> Unpin for Receiver<T>
impl<T> UnwindSafe for Receiver<T>
Blanket Implementations§
Source§impl<C> AsyncPosition<()> for C
impl<C> AsyncPosition<()> for C
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